An array for multiple LHS assignment cannot contain expressions
3 Ansichten (letzte 30 Tage)
Ältere Kommentare anzeigen
Stephen Thompson
am 13 Jun. 2018
Kommentiert: Fangjun Jiang
am 13 Jun. 2018
I have array of values (192x2) and I want find the minimal value index (I don't care about the value);
This syntax makes sense to me but is not permitted:
index = zeros (ratio_channels, 1);
for i = 1: ratio_channels
[~, index (i)] = min (compare_onset(i), [], 2)
end
Error: An array for multiple LHS assignment cannot contain expressions.
Running it another way works but doesn't give me what I want (the value but not the index):
for i = 1: ratio_channels
index (i) = min (compare_onset(i), [], 2)
end
1 Kommentar
Fangjun Jiang
am 13 Jun. 2018
what is the size of compare_onset(i), for example
size(compare_onset(1))
Akzeptierte Antwort
Fangjun Jiang
am 13 Jun. 2018
Remove the white space in "index (i)"
[~, index(i)] = min (compare_onset(i), [], 2)
0 Kommentare
Weitere Antworten (0)
Siehe auch
Kategorien
Mehr zu Matrix Indexing finden Sie in Help Center und File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!