matrix dimensions must agree

Error using ./ Matrix dimensions must agree.
Error in secure>pushbutton2_Callback (line 237) qc=tstval./stval;

5 Kommentare

Stephen23
Stephen23 am 13 Mär. 2017
Please show us the exact output of these commands:
size(tstval)
size(stval)
Ganesh Hegade
Ganesh Hegade am 13 Mär. 2017
check size of tstval and stval
vasantha malairamar
vasantha malairamar am 14 Mär. 2017
tnk u
vasantha malairamar
vasantha malairamar am 14 Mär. 2017
we fit the first in Stile into the first in Starget, fit the second in Stile into the second in Starget , and so on.
Jan
Jan am 14 Mär. 2017
@vasantha malairamar: And this can work only, if both variables have the same number of elements. But they don't. We cannot guess why and what you want to do instead. But you can explain this.

Antworten (1)

Jan
Jan am 13 Mär. 2017

0 Stimmen

The error message is clear: In the expression tstval ./ stval both variables must have the same size or one is a scalar. You can examine this with the debugger. Type this in the command window:
dbstop if error
Now run your code again until Matlab stops. Now check the sizes of the variables either in the workspace browser or in the command window:
size tstval
size stval

Diese Frage ist geschlossen.

Tags

Noch keine Tags eingegeben.

Gefragt:

am 13 Mär. 2017

Geschlossen:

am 20 Aug. 2021

Community Treasure Hunt

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

Start Hunting!

Translated by