Substituting numbers into a matrix with symbolic values
Ältere Kommentare anzeigen
For my code, I set certain values like x, y , z to be symbolic at the beginning. I wanted to create a matrix with these in them, then later sub in values.
If I have a matrix currently in the form: [x+y; y+z; z+x; y+z]
How can I set it up to calculate each entry when x, y, and z are certain numerical values?
I tried a for loop such as:
for x = 1
for y = 2
for z = 3
[A] = [matrix of variables with symbolic variables]
end
end
end
but I just get a return of my symbolic matrix and not numerical values like I want.
Any suggestions or help? Thanks in advance
Akzeptierte Antwort
Weitere Antworten (1)
Walter Roberson
am 21 Apr. 2012
subs([x+y;y+z;z+x;y+z], {x,y,z}, {1,2,3})
Kategorien
Mehr zu Logical finden Sie in Hilfe-Center und File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!