'subs' not working as i want
1 visualización (últimos 30 días)
Mostrar comentarios más antiguos
Fernando Pérez Lara
el 8 de Dic. de 2018
Comentada: Fernando Pérez Lara
el 9 de Dic. de 2018
Hello guys,
I have this equation -x^2/2 + 2*x - (5*I)/2 and I'm trying to replace the letter x with a the matrix A and the letter I with the matrix B.
A = 0 1 0
0 0 1
2 -5 4
B = eye(3)
The problem is that when I write subs(eq, x, A) and subs(eq, I, eye(3)) I get a very big matrix, and this is not the answer.
2 comentarios
YT
el 8 de Dic. de 2018
Editada: YT
el 8 de Dic. de 2018
It makes sense that your result will be "a very big matrix". subs(eq, x, A) will give you a 3x3 matrix because you substitute x for a 3x3 matrix. With subs(eq, I, eye(3)) you are trying to substiute an identity matrix in your previous subsituted matrix. So what do you expect the result to be then?
Respuesta aceptada
Más respuestas (0)
Ver también
Categorías
Más información sobre Function Creation 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!