indexing must appear last in an index espression
8 Ansichten (letzte 30 Tage)
Ältere Kommentare anzeigen
Bhargavkrishna Kondreddy
am 24 Okt. 2016
Bearbeitet: Jan
am 26 Okt. 2016
Xsum =A(1)(:,3); error is at this point for k = 2:299 Xsum=Xsum+A(k)(:,3); end
0 Kommentare
Akzeptierte Antwort
Jan
am 25 Okt. 2016
Bearbeitet: Jan
am 26 Okt. 2016
A(k) is the k.th element of the array A. Then indexing another time by "(:,3)" is not valid Matlab syntax. We cannot guess the purpose of this code, so please explain the class and dimensions of A and what you want to achieve.
[EDITED, after you provided the code]
I guess that:
Xsum = A(1)(:,3)
should be
Xsum =A{1}(:,3)
and the same for "Xsum=Xsum+A(k)(:,3)".
Compare it with the lines:
Ysum = A{1}(:,4); for m = 2:299 Ysum=Ysum+A{m}(:,4); end
0 Kommentare
Weitere Antworten (1)
Bhargavkrishna Kondreddy
am 25 Okt. 2016
1 Kommentar
Jan
am 26 Okt. 2016
Please format your code using the "{} Code" button. Currently it is not readable.
Siehe auch
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!