MATLAB Answers

Is there a way to start indexing with 0 in MATLAB?

94 views (last 30 days)
IBM watson
IBM watson on 2 Jan 2019
Commented: IBM watson on 3 Jan 2019
a=[4 2 5 2]
can I make this happen?
a(0)=4

  0 Comments

Sign in to comment.

More Answers (1)

Bruno Luong
Bruno Luong on 2 Jan 2019
Edited: Bruno Luong on 2 Jan 2019
Yes, but you won't get much support by built-in array stock function
>> M = containers.Map('KeyType','uint32','ValueType','double')
M =
Map with properties:
Count: 0
KeyType: uint32
ValueType: double
>> M(0)=3
M =
Map with properties:
Count: 1
KeyType: uint32
ValueType: double
>> M(0)
ans =
3
>>

  5 Comments

Show 2 older comments

Sign in to comment.

Sign in to answer this question.

Tags