MATLAB Efficiently Solve Matrix of ODE's in MATLAB without Rewriting as Column Vectors

  • Thread starter Thread starter juef
  • Start date Start date
  • Tags Tags
    Matlab Matrix
AI Thread Summary
The discussion revolves around solving the system X' = f(X), where X is a square matrix, using MATLAB. The challenge arises because MATLAB solvers typically require X to be a column vector. While rewriting X and f(X) as column vectors is an option, it may lead to inefficiencies and complications. A participant suggests using the reshape command in MATLAB as a straightforward solution, which significantly simplifies the process and enhances efficiency. This approach is well-received, highlighting its effectiveness in addressing the initial concern.
juef
Messages
27
Reaction score
0
Hey all,

Consider the system X' = f(X), where X is a square matrix. I would like to solve this system with MATLAB, but all of its solvers require X to be a column vector.

Of course, it would be possible to rewrite X' and f(X) as column vectors, but I guess some efficiency would be lost. It would also be a lot of pain to do

So, does anyone know of a simpler way to do such a thing? Thank you!
 
Physics news on Phys.org
It's not a pain to do with the reshape command.
 
:shy: Why on Earth didn't I think of that? You can't possibly imagine how much that just helped me! Thank you very much!
 

Similar threads

Back
Top