[英]matlab code for defining function 'int' for input arguments type 'double'
[英]MATLAB function arguments in my code
我有一個 MATLAB 代碼,我知道它是如何工作的。在主代碼中
%Tuning
tunestruct = {samplefunc,numreps,data_type,MS_criterion};
[Xtrain,optk,optsig2,tuningExtras] = tuneSKSC(data,kernel_type,maxk,tunestruct);
tuneSKC.m 開始於
function [Xtrain,optk,optsig2,extras] = tuneSKSC(datastruct,kernel,maxk,tunestruct)
我的問題是tunestruct
是什么?那么,函數的data,kernel_type,maxk,tunestruct arguments
是data,kernel_type,maxk,tunestruct arguments
嗎?
我已經粘貼了 tunestruct.m http://pastebin.com/cFH433Md
tunestruct
實際上是一個由一堆其他變量組成的元胞數組。
元胞數組是一種帶有索引數據容器的數據類型,稱為元胞,其中每個元胞可以包含任何類型的數據。 元胞數組通常包含文本字符串列表、文本和數字的組合或不同大小的數值數組。
制作元胞數組而不是每次將這些參數作為單獨的值傳遞的原因是代碼具有非常特定的模式來處理這組參數,以防它們不作為參數傳遞,如本代碼段所述'已經提供:
if exist('tunestruct','var')
if ~iscell(tunestruct)
tunestruct = {tunestruct,1};
end;
if(strcmp(tunestruct{1},'furs'))
tunestruct{2} = 1; %furs is deterministic, only one repetition is enough
end
s1 = ~strcmp(tunestruct{3},'net_unw') && strcmp(tunestruct{4},'Modularity');
if(s1)
tunestruct{4} = 'AMS'; %Modularity is used for unweighted network data
warning('\nNot possible to use Modularity, using AMS instead...');
end
end;
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.