indexing in loop, cell
1 回表示 (過去 30 日間)
古いコメントを表示
I have cell Z
in cell Z{1}=
Columns 1 through 6
[1x3 double] [1x3 double] [1x3 double] [1x3 double] [1x3 double] [1x3 double]
Column 7
[1x3 double]
Z{2}= [1x3 double] [1x3 double]
MAXP= (max count object in cell Z{1} have 7 object
Z{2} have 2 oject)
MAXP=1
my code:
for i=1:size(Z,2)
if length(Z{i})>MAXP
for j=1:length(Z{i})
a=([Z{i}{j};M(i,:)]);
odch(j,:)=std(a);
end
odch
maxval=max(max(odch));
[i_max,j_max]=find(odch==maxval);
for j=1:length(Z{i})
for c=1:length(Z{i}{j})
if j==i_max && c==j_max
value=Z{i}{j}(c)
end
end
end
number=value/2
W={};
for j=1:length(Z{i})
if all((Z{i}{j})>number)
W{i}{j}=Z{i}{j};
else
W{i+1}{j}=Z{i}{j};
end
end
end
end
W
When i have size(Z,2)=2, I dont know how I then index W to me it do not overwrite.
I need overwrite the variable odch.
0 件のコメント
採用された回答
その他の回答 (0 件)
参考
カテゴリ
Help Center および File Exchange で Loops and Conditional Statements についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!