Error Assignment has more non-singleton rhs dimensions than non-singleton subscripts
Mostrar comentarios más antiguos
Hello there, I'm a Matlab newbie. I'm getting this error when running a function
Assignment has more non-singleton rhs dimensions than non-singleton subscripts
Assignment has more non-singleton rhs dimensions than non-singleton subscripts
Error in AQDATABT (line 251)
mpc.branch(idr,3)=(Rphase(ind)*LUNG(i))/1000;
and I can't understand where's the error.
Rphase(ind) is 1.9 and LUNG(i) is 9.
Thanks for help
4 comentarios
Iain
el 24 de Sept. de 2014
What is "idr"?
Put a breakpoint on the line in question in the code (or use the stop on error option) and type the following on the command line to see what size the two sides of the assignment are. They need to be the same size (or at least any differences must just be of the form of extra singleton dimensions - i.e. '1' in the size output) for the assignment to make sense.
size( mpc.branch(idr,3) )
size( Rphase(ind)*LUNG(i) )
Type:
doc dbstop
if you want top know about adding breakpoint options programatically. Personally I just use the options in the editor 'Breakpoints -> Stop on errors' to stop only when there is an error or just click on the margin next to the line number to add a specific breakpoint, but a lot of people seem to use the dbstop approach instead).
Simone
el 24 de Sept. de 2014
Simone
el 24 de Sept. de 2014
Respuestas (0)
Categorías
Más información sobre Matrices and Arrays en Centro de ayuda y File Exchange.
Productos
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!