How to change one dinmension list to two dimensions array with function "ind2sub"?
Info
Diese Frage ist geschlossen. Öffnen Sie sie erneut, um sie zu bearbeiten oder zu beantworten.
Ältere Kommentare anzeigen
I have a vector but I need to construct a new array nXm and take his elements from the vector using "ind2sub" fuction
1 Kommentar
dpb
am 6 Okt. 2016
OK, and what's preventing you from doing so?
We certainly can't tell you anything specific w/o some definition of which elements are in question and how it is to be determined that those are, indeed, the ones.
And, depending on the above, ind2sub might not even be needed or the best solution...
Antworten (1)
Walter Roberson
am 6 Okt. 2016
If your vector is V, then
[r, c] = ind2sub([n, m], V)
will give you the row (r) and column (c) indices into an n x m array that the elements of V represent.
But what do you want to do with the row and column indices once you have them?
Diese Frage ist geschlossen.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!