Filter löschen
Filter löschen

Error is occured when I changed version of Matlab

2 Ansichten (letzte 30 Tage)
Sergey Kasyanov
Sergey Kasyanov am 30 Jan. 2018
Kommentiert: Sergey Kasyanov am 28 Mär. 2018
I have a lot of the code which work correctly in the Matlab 2013b but when I tried evaluate it on the machine with Matlab 2016a it returns an error:
Too many outputs requested. Most likely cause is missing [] around left hand side that has a comma separated list expansion.
Line with an error is next
L.GroundWire(i).(FN{j})=GroundWire.(FN{j}){ISb};
where
ON LEFT
L - object of user-defined class
GroundWire - property of L, structure
FN{ j } - name of field of GroundWire
ON RIGHT
GroundWire - structure
FN{ j } - name of field. each field consists of cells with data
ISb - integer number
What have changed in the new version of Matlab?
I can add that if I contain the expression on the left in braces it causes an another error in both versions of Matlab.
  1 Kommentar
Adam
Adam am 30 Jan. 2018
Simplest way to find out is with the debugger, just put
GroundWire.(FN{j}){ISb}
on the command line and see what the result is. You can also try putting the left-hand side on the command line too:
L.GroundWire(i).(FN{j})
and see what it evaluates to.

Melden Sie sich an, um zu kommentieren.

Akzeptierte Antwort

Jan
Jan am 30 Jan. 2018
I guess, that ISb is not a scalar. Test this using the debugger: https://www.mathworks.com/help/matlab/matlab_prog/debugging-process-and-features.html. If this is true, this might help:
L.GroundWire(i).(FN{j}) = [GroundWire.(FN{j}){ISb}];
But most likely ISb is not expected to address multiple cell elements, such that the actual problem must be before this line while creating ISb.
  1 Kommentar
Sergey Kasyanov
Sergey Kasyanov am 28 Mär. 2018

Seems to be truth if another functions changed and ISb became an array but I didn't find real cause for this error.

Thanks.

Melden Sie sich an, um zu kommentieren.

Weitere Antworten (0)

Produkte

Community Treasure Hunt

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

Start Hunting!

Translated by