start index in matrix with zero
1 回表示 (過去 30 日間)
古いコメントを表示
how i start indexing in mAtrix from 0?
for M=1:1:m-1
A1=A*x2(:,M);
A2(:,M)=round(mod(A1,N));
end
for M=1:m-1
ss=A2(1,M)
jj=A2(2,M)
a4(ss,jj)=A2(3,M);
end
index for a4 come 0 .i cant change it. how i use zero index?
0 件のコメント
採用された回答
Matt J
2014 年 5 月 5 日
You could use this customized matrix type that uses zero-based indexing
http://www.mathworks.com/matlabcentral/fileexchange/33301-zero-based-indexable-arrays--oop-exercise-
but I don't really recommend it. Why not just do
a4(ss+1,jj+1)=A2(3,M);
0 件のコメント
その他の回答 (0 件)
参考
カテゴリ
Help Center および File Exchange で Matrix Indexing についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!