Azzera filtri
Azzera filtri

kvalue=zer​os(size(da​ta,1),size​(data,1),s​ize(data,2​));

2 visualizzazioni (ultimi 30 giorni)
i have following codes for compute of kernel foe fuzzy cmeans based on kernel or kfc :
function kvalue=compute_kvalue(data)
v=6.1;
var = (max(data)-min(data)).^2/v;
kvalue=zeros(size(data,1),size(data,1),size(data,2));
for i=1:size(data,1)
for j=i:size(data,1)
kvalue(i,j,:)=exp(-abs(data(i,:)-data(j,:)).^2./var);
kvalue(j,i,:)=kvalue(i,j,:);
end
end
end
line 4 ,what means?

Risposta accettata

Wayne King
Wayne King il 2 Mar 2013
Modificato: Wayne King il 2 Mar 2013
kvalue=zeros(size(data,1),size(data,1),size(data,2));
The above line is just initializing an array of zeros that has dimensions MxMxN where M is the number of rows in data and N is the number of columns.
So that,
data = randn(8,4);
kvalue=zeros(size(data,1),size(data,1),size(data,2));
kvalue is a matrix of zeros that is 8x8x4. The matrix of zeros is then filled with values in the following for loop.

Più risposte (0)

Categorie

Scopri di più su Loops and Conditional Statements in Help Center e File Exchange

Tag

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by