Index exceeds matrix dimensions.

1 Ansicht (letzte 30 Tage)
Grillteller
Grillteller am 3 Feb. 2017
Bearbeitet: Andrei Bobrov am 3 Feb. 2017
Hi, i get the following error and didn't find a solution yet
MATLAB code
syms L1 L2 L3 L4 L5 L6 L7 L8 L9 L10 L11
X = [L1; L2; L3; L4; L5; L6; L7; L8; L9; L10; L11];
syms Xi
BGx = sym(zeros(6,1));
for i=1:1:6
BGx(i,1)=L1*Xi(i)
end
I want to get 6 terms like L1*Xi1, L1*Xi2 etc... Thanks for your help

Akzeptierte Antwort

Andrei Bobrov
Andrei Bobrov am 3 Feb. 2017
Bearbeitet: Andrei Bobrov am 3 Feb. 2017
L = sym('L',[1,11]);
Xi = sym('Xi',[1,6]);
BGx = L.'*Xi;
or in your case
BGx = sym('L1')*sym('Xi',[1,6]);

Weitere Antworten (0)

Kategorien

Mehr zu Loops and Conditional Statements finden Sie in Help Center und File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by