haozhg/odmd

Matrix dimensions must agree.

jodyngo opened this issue · 3 comments

I am running the code and the program shows below error

Error using .*
Matrix dimensions must agree.

Error in OnlineDMD/initialize (line 86)
Xq = Xq.*weight;

Error in online_demo (line 79)
odmd.initialize(x(:,1:q),y(:,1:q));

Could you please help me resolve it!

Try Xq = Xq * weight? I did not seem to find the <.*> operation in my code, could you please direct me to the line of code?

Please refer to below link

Xq = Xq.*weight;

Hey, so the matrix must be of shape (n, q) (q by n will not work), where n is state dimension and q is the first q snapshots (q > n). See this https://github.com/haozhg/odmd-matlab/tree/main/matlab for example usage.
Also, i would recommend using the python implementation: https://github.com/haozhg/odmd#use-pip, just need pip install odmd