Error: flag=0 (initialize), at start of simulation. --> subscripted assignmetn dimension mismatch

12 views (last 30 days)
Hello,
I've a simulink file to simulate an building with a PV-collector that's running correctly. When I want to the same file run for another model I got this error: --> Error in 'Finalmodel2' while executing MATLAB S-function 'wavosimulinksfun', flag=0 (initialize), at start of simulation. --> subscripted assignmetn dimension mismatch.
I compared the m-file (Finalmodel1.m) from first model with the model that get's the error (Finalmodel2.m) but there are really no differences except some walls etc. How can I remove this error?
Thanks in advance! Lisan
  1 Comment
Geoff Hayes
Geoff Hayes on 29 Jul 2014
What happens if you try and run Finalmodel2.m outside of Simulink? Can you supply some inputs to this function/script and execute it successfully?
The error message subscripted assignment dimension mismatch typically means that the code is trying to assign too much or too little data from the source matrix to the destination matrix. i.e.
A = magic(4); % 4x4 matrix
B = magic(5); % 5x5 matrix
A(:,4) = B(:,5) % trying to assign five elements to space for four

Sign in to comment.

Answers (0)

Categories

Find more on Modeling in Help Center and File Exchange

Community Treasure Hunt

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

Start Hunting!