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 comentario

Sagar Damle
Sagar Damle el 4 de Ag. de 2014
But why do you want the index to start from zero ? In MATLAB,it starts from one and this does not pose any problem !!

Iniciar sesión para comentar.

Respuestas (2)

Roger Wohlwend
Roger Wohlwend el 4 de Ag. de 2014

0 votos

You cannot do that. The first element is a(1,1) and there's no way to change that.
Azzi Abdelmalek
Azzi Abdelmalek el 4 de Ag. de 2014
Editada: Azzi Abdelmalek el 4 de Ag. de 2014
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 comentarios

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

Iniciar sesión para comentar.

Categorías

Preguntada:

el 4 de Ag. de 2014

Comentada:

Rik
el 3 de Abr. de 2021

Community Treasure Hunt

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

Start Hunting!

Translated by