Help using symolic variable
Afficher commentaires plus anciens
I am trying to implement a piece of code:
n = 1000;
syms l;
m = sym('m', [ 1 n ] );
x = sym( 0 );
for i =1:1:n
J_j(1,i) = [ (1/3)*m(1,i)*l*l x x -(1/2)*m(1,i)*l;
x x x x;
x x x x;
-(1/2)*m(1,i)*l x x m(1,i) ];
end
Now, when I try to implement this code, it gives me following error:
??? Error using ==> mupadmex
Error in MuPAD command: Invalid index [list];
during evaluation of 'matchNonSingletonLHS'
Error in ==> sym.sym>sym.subsasgn at 1435
C = mupadmex('symobj::subsasgn',A.s,B.s,inds{:});
can anyone help?
Thank you so much in advance.
Réponse acceptée
Plus de réponses (1)
Alok
le 20 Oct 2011
0 votes
Catégories
En savoir plus sur Common Operations dans Centre d'aide et File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!