Info

Diese Frage ist geschlossen. Öffnen Sie sie erneut, um sie zu bearbeiten oder zu beantworten.

# Subscripted assignment dimension mismatch when using coeffs command

1 Ansicht (letzte 30 Tage)
shahin hashemi am 12 Dez. 2017
Geschlossen: MATLAB Answer Bot am 20 Aug. 2021
dear all
i have code like below:
clc
clear all
syms q(i) teta(i) eb(i)
ebd = sym('ebd', [1 2], 'real');
qd = sym('qd', [1 2], 'real');
i=2;
for i=1:size(wl,1)
end
at end i get error Subscripted assignment dimension mismatch.
and answer should be like this :
[ cos(q(2))*sin(teta(2)), -sin(q(2)), -cos(q(2))*cos(teta(2))*sin(teta(2))] [ebd ]
[cos(teta(2)) , 0, sin(teta(2))^2] [qd ]
i understand why i get this error and that is because of Ecollected(3) that have 2 value [cos(teta(2) sin(teta(2))^2] and it cant fit in 3 column and it should be like [cos(teta(2) 0 sin(teta(2))^2] and 2 other Ecollected(2) ,Ecollected(1) works fine
i really appreciated if someone can help me

### Antworten (1)

Walter Roberson am 12 Dez. 2017
w(i, idx) = wtemp;

### Community Treasure Hunt

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

Start Hunting!

Translated by