Hello guys,
I have a simulink file that is basically giving as output the control signal of many switches "1" and "0", I took the outputs of the clock, and all the data to workspace using "simout" as array, and all the arrays (time, command of all switches) have the same size (320).
Now I am trying to use in a different simulink model these outputs from workspace in order to simulate my model, I am getting the following error for all the "simin" from workspace :
"Invalid matrix variable specified as workspace input in 'untitled4/From Workspace'. The matrix data must be a real, double, have two dimensions, and at least two columns. The first column must contain time values and the remaining columns the data values. Matrix values cannot be Inf or NaN."
Can You please suggest a solution for my problem
thanks in adavnce

댓글 수: 2

Can you provide the simout data that you are using as input to the From Workspace block?
fadi awar
fadi awar 2021년 6월 1일
The data are "0" and "1" of type double.
T= 0 0.0100 0.0200 0.0300 0.0400 0.0500 0.0600 0.0700 0.0800 0.0900 0.1000 0.1000 0.1000 0.1100 0.1200 0.1300 0.1400 0.1500 (it continues to reach value 3 as for 3 seconds)
and one of the switching vectors are:
Sw1= 0 0 1 1 1 1 1 0 0 0 0 0 0 0 0 0 0 0
those are the values I get in the workspace

댓글을 달려면 로그인하십시오.

 채택된 답변

Sulaymon Eshkabilov
Sulaymon Eshkabilov 2021년 6월 1일

0 개 추천

Hi,
In this case, you'd need to generate two column data from your imported data ([To Woskspace] block) into matlab workspace, e.g.:
DATA = out.simout; % From your alread imported data from the 1st Simulink model
Now, in your [Simin], specify the input variable name: DATA
Run your new Simulink model.
Good luck.

댓글 수: 6

fadi awar
fadi awar 2021년 6월 2일
편집: fadi awar 2021년 6월 2일
Hey,
Thank you so much it runs perfectly,
I am doing this beacause I have a system that requies calculation with less than 0.1 sampling mode and the system that I am simulating has PV system and power electronics so if I want to run them both at the same time its taking too mucch time,so I figure it out to run them separately, and it works.
Thank you for your help
Sulaymon Eshkabilov
Sulaymon Eshkabilov 2021년 6월 2일
편집: Sulaymon Eshkabilov 2021년 6월 2일
Most welcome!
@Sulaymon Eshkabilov I am having a similar error as stated above. In my case I have one model file of Simulink. So when for the first time I run the model and I send one signal which I named as "Fs" in the "To Workspace" block. Then I use this "Fs" from the matlab workspace to calculate 'Rate of change of this Frequency signal' using matlab script. I have named the rate of change of frequency as variable "avg_rocof". Now I wanted to use this "avg_rocof" variable in my Simulink model using "FromWorkspace" block. But when I run the model I get the following above error
" Invalid matrix variable specified as workspace input in 'IEEE_14_Bus_System_SM_FFR/From Workspace'. The matrix data must be a real, double, have two dimensions, and at least two columns. The first column must contain time values and the remaining columns the data values. Matrix values cannot be Inf or NaN.
Can you please assist in this problem?
Post your question.
My 'avg_rocof' data is as shown in the figure that I have attached. It's ' -0.2762 ' 1x1 double . And I want to use this 'avg_rocof' value using "From Workspace block " in my one of the subsystem of my Simulink model as an input. But I am getting this error """ Invalid matrix variable specified as workspace input in 'IEEE_14_Bus_System_SM_FFR/From Workspace'. The matrix data must be a real, double, have two dimensions, and at least two columns. The first column must contain time values and the remaining columns the data values. Matrix values cannot be Inf or NaN.
Moreover the script I wrote to calculate "avg_rocof" is ,
f = Fs.signals.values; % frequency signal
Dt = 20e-6; % sampling step size
R = 0; % rocof initialisation
for k = 196002:1:316002
R = R + (f(k)- f(k-1))/Dt;
end
avg_rocof = R / (316002-196002);
display(avg_rocof);
In this case, you can use a Constant block and enter the variable name avg_rocof into Constant value: window of Constant block that can be opened by double clikcing on it.

댓글을 달려면 로그인하십시오.

추가 답변 (0개)

카테고리

도움말 센터File Exchange에서 Modeling에 대해 자세히 알아보기

제품

Community Treasure Hunt

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

Start Hunting!

Translated by