Help with non working for loop for generating a matrix

1 visualización (últimos 30 días)
Jeff
Jeff el 30 de Mzo. de 2020
Editada: Jeff el 4 de Jul. de 2020
  1 comentario
James Tursa
James Tursa el 31 de Mzo. de 2020
Editada: James Tursa el 31 de Mzo. de 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?

Iniciar sesión para comentar.

Respuesta aceptada

Matt J
Matt J el 31 de Mzo. de 2020
Editada: Matt J el 31 de Mzo. de 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))'

Más respuestas (0)

Categorías

Más información sobre Creating and Concatenating Matrices en Help Center y File Exchange.

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by