MATLAB: Initial state vector “X0” must be a real vector of length 70

power systemwind

Hi, I am trying to add some components (a generator) to a previously built system in Simulink (actually it is the "Power_wind" file) and getting the following message:
Initial state vector "X0" must be a real vector of length 70
How could I resolve this problem?
Even if I delete one of the components appears a similar message. Thank you for your help. Rick

Best Answer

Go to your Simulink model, select menu "Simulation">"Configuration Parameters ...", click "Data Import/Export" at the left column, look at the right, do you see "Initial State" is checked and there is a "X0" there?
If Yes, that is try to use the value in the variable "X0" to set the initial state. Sounds like the value for "X0" in the workspace does not meet the criteria.
To make it work, set X0=zeros(1,70). This is just trying to see if it can pass this error stage. To set the proper value, you have to look into your own model or document.