Solving an Equation for Different Values of Constants
Show older comments
I am solving a simple equation for x which has constants a b and c. a and b are matrices and c is a constant value. I want 4 values of x for 4 values of a and b. How can I do that? I have written the following code but it doesnt work.
>> a=[2 1 2 3];
>> b=[6 7 8 89];
>> c=123;
>> syms x positive
>> eqn=x^2*a*c-x*b*c+20;
>> y=solve(eqn,x)
This code doesn't work The code works for one value of a and b. For example
>> eqn=x^2*a(1)*c-x*b(1)*c+20;
>> y=solve(eqn,x)
This way it gives one answer. But I want 4 answers for x.
Accepted Answer
More Answers (0)
Categories
Find more on Function Creation in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!