help needed on using "solve" for equation including element from array
Afficher commentaires plus anciens
Hello, I'm having problem when using "solve" function. For example,
clear a k x y;
a=[1, 2];
for k=1:1:2
y=subs(abs(solve('x^2+a(k)^2-9')))
end
Matlab gave me
y =
abs(a(2)^2-9)^(1/2)
abs(a(2)^2-9)^(1/2)
instead of numerical results. Of course, the real problem I'm trying to solve is much more complicated, and the array "a" is calculated by another code and actually a more complicated matrix, so I cannot manually assign each a(k) for a numerical number. Could anybody help me on this? I tried to search for an answer here but failed. Many thanks for any help.
Réponse acceptée
Plus de réponses (0)
Catégories
En savoir plus sur Linear Algebra dans Centre d'aide et File Exchange
Produits
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!