Symbolic variable array problem
1 Ansicht (letzte 30 Tage)
Ältere Kommentare anzeigen
Amit Kumar
am 27 Okt. 2013
Beantwortet: Danilo NASCIMENTO
am 27 Okt. 2013
Hi, I am trying to create an array in symbolic variable. However I am not successful in this task, something is going wrong. I will welcome any help. My code
syms shafun
syms xp
nel=3;
for i=1:1:nel
if i==1
shafun(i,:)=([(xp-(le*i))/-le,(xp)/le]);
else
shafun(i,:)=([(xp-(le*i))/-le,(xp-(i-1))/le]);
end
end
The result is shafun of size 3x1, but I am expecting it to be 3x2 as I am specifying two columns. Why only first column is computed and not second one for all rows? Any help? Thanks in advance.
0 Kommentare
Akzeptierte Antwort
Danilo NASCIMENTO
am 27 Okt. 2013
You don't need to specify shafun as a symbolic variable, just push it out and you'll have shafun as a matrix of 3x2.
0 Kommentare
Weitere Antworten (0)
Siehe auch
Kategorien
Mehr zu Assumptions finden Sie in Help Center und File Exchange
Produkte
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!