Help with non working for loop for generating a matrix

1 view (last 30 days)
jfjfj
  1 Comment
James Tursa
James Tursa on 31 Mar 2020
Edited: James Tursa on 31 Mar 2020
c is a vector, so what is x(c) supposed to mean?
Can you just post the equations you are trying to code and we can help you code them?

Sign in to comment.

Accepted Answer

Matt J
Matt J on 31 Mar 2020
Edited: Matt J on 31 Mar 2020
One approach is to write x,y, and A as matrix-valued anonymous functions of c, e.g.,
x=@(c)(4-c)./(6+c);
y=@(c)10./(6+c);
A = @(c) [-1-2.*x(c)+y(c) x(c);-6.*y(c) 4-2.*c.*y(c)-6.*x(c)];
fplot(@(c) trace(A(c)), [0,2.23])
xlabel 'c'
ylabel 'Trace(A(c))'

More Answers (0)

Categories

Find more on Creating and Concatenating Matrices 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!