matrix starting index from zero

hello everybody how we can change matrix first index? i mean that start from zero instead of one. for example
a=[60,78;100,400;200,600]
a(0,0)=60
a(1,0)=100

댓글 수: 1

Sagar Damle
Sagar Damle 2014년 8월 4일
But why do you want the index to start from zero ? In MATLAB,it starts from one and this does not pose any problem !!

댓글을 달려면 로그인하십시오.

답변 (2개)

Roger Wohlwend
Roger Wohlwend 2014년 8월 4일

0 개 추천

You cannot do that. The first element is a(1,1) and there's no way to change that.
Azzi Abdelmalek
Azzi Abdelmalek 2014년 8월 4일
편집: Azzi Abdelmalek 2014년 8월 4일

0 개 추천

Subscript indices must either be real positive integers or logicals
you can work with your indices by adding 1 to them
a(0+1,0+1)
a(1+1,0+1)

댓글 수: 3

mahsa
mahsa 2014년 8월 5일
thanks a million i found it
Mahnoor Naseer
Mahnoor Naseer 2021년 4월 3일
pls tell me how you did it
Rik
Rik 2021년 4월 3일
It is unlikely mahsa is still monitoring this thread. Why don't you explain why you want this?

댓글을 달려면 로그인하십시오.

카테고리

도움말 센터File Exchange에서 Matrix Indexing에 대해 자세히 알아보기

질문:

2014년 8월 4일

댓글:

Rik
2021년 4월 3일

Community Treasure Hunt

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

Start Hunting!

Translated by