vec2ind problem?

2 views (last 30 days)
Mohd Azha Mohamad Salleh
Mohd Azha Mohamad Salleh on 20 May 2019
Answered: Walter Roberson on 20 May 2019
Hi There...
I got xxx 3 x 6 double as below
xxx =
1 0 0 0 0 0
0 1 0 0 1 0
0 0 1 0 0 1
I use vec2ind to change the value into index value..1..2...3
yyy = vec2ind(xxx)
yyy =
1 2 3 1 2 3
Why the 0
0
0 also changed to 1 ?

Answers (1)

Walter Roberson
Walter Roberson on 20 May 2019
The behavior for that case is undefined, so it is permitted to return anything it wants.

Products


Release

R2018b

Community Treasure Hunt

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

Start Hunting!