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

1 次查看(过去 30 天)
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?

采纳的回答

Wayne King
Wayne King 2013-3-2
编辑:Wayne King 2013-3-2
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.

更多回答(0 个)

类别

Help CenterFile Exchange 中查找有关 Loops and Conditional Statements 的更多信息

标签

Community Treasure Hunt

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

Start Hunting!

Translated by