start index in matrix with zero

조회 수: 4 (최근 30일)
fati gh
fati gh 2014년 5월 5일
답변: Matt J 2014년 5월 5일
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?

채택된 답변

Matt J
Matt J 2014년 5월 5일
You could use this customized matrix type that uses zero-based indexing
but I don't really recommend it. Why not just do
a4(ss+1,jj+1)=A2(3,M);

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Matrix Indexing에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by