Subtracting a Vector from a Scalar-Multiplied Matrix
1 visualización (últimos 30 días)
Mostrar comentarios más antiguos
Athanasios Paraskevopoulos
el 4 de Abr. de 2024
Comentada: Paul
el 5 de Abr. de 2024
Let's say that we have the following two matrices and we want to calculate . We know that it is not defined, but MATLAB gives me the following result.Could anyone explain me why that happens?
C=[1 2; 2 1]
E=[1;2]
3*C-E
5 comentarios
Torsten
el 5 de Abr. de 2024
It's just a convention to get rid of the bsxfun - there is nothing to explain (or even justify).
Respuesta aceptada
Steven Lord
el 4 de Abr. de 2024
8 comentarios
Paul
el 5 de Abr. de 2024
Even prior to R2016B, as far back as to the very first release as far as I know, Matlab implemented scalar expansion. Code like this has always worked
eye(2) - 1
even though subtracting a scalar from a matrix is not mathematically rigorous.
Más respuestas (0)
Ver también
Categorías
Más información sobre Get Started with MATLAB 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!