How to display the result of a cycle in a single matrix of a certain size
古いコメントを表示
Hello, I have a cycle:
l=[];
m=[1 0 2 3 5 7 1; 1 0 2 3 5 7 1]
for k=1:2
r=m(k,1:7);
for j=r
if j==0
z = zeros(1,8,'int8');
z(1)=1;
l=[l; z];
else
z = zeros(1,8,'int8');
z(j+1)=j;
l=[l; z];
end
end
end
Input - a 2 strings, so as to make the output results have dimension 2x7*8 = 2x56???
In current code the results output as matrix 14x8
3 件のコメント
Walter Roberson
2014 年 1 月 18 日
Why are you setting all of z to 0 each time?
Which variable are you hoping will become 2 x 56 ?
Meffix
2014 年 1 月 18 日
Image Analyst
2014 年 1 月 18 日
Clear as mud.
採用された回答
その他の回答 (0 件)
カテゴリ
ヘルプ センター および File Exchange で Audio and Video Data についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!