Simulink block from workspace

조회 수: 3 (최근 30일)
dd123
dd123 2011년 11월 8일
댓글: charanarur panem 2018년 7월 9일
I am new to matlab. I have some problems when I use the simulink block 'from workspace'.First, I opened a file in the command window.the first column of the file is time information and the second column is the signal value. Let say the name displayed on the workspace for the file is V1. Then,I placed the block 'from workspace' in simulink. I put V1 for the block parameter, 'Data:'. It pop up an error message 'invalid matrix format'. May I know what should I change to be able to get the information from the workspace?

답변 (2개)

Fangjun Jiang
Fangjun Jiang 2011년 11월 8일
What file are you open, .mat or .txt or something else?
In Command Window, do the following,
t=(0:0.1:10)';
y=sin(t);
simin=[t y]
Then drag a "From Workspace" block to an empty model, drag a scope, connect it and run the simulation. Do you see a sine curve in the scope?
  댓글 수: 3
Fangjun Jiang
Fangjun Jiang 2011년 11월 9일
What do you get if you run size(t) and size(y)? Is the data in t strictly incremental?
dd123
dd123 2011년 12월 5일
Thanks for your help. I managed to identify the problem.The last value in the file is not valid and that cause the problem when I tried to load the data with simulink block 'from workspace'.

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


Guy Rouleau
Guy Rouleau 2011년 11월 9일
편집: John Kelly 2015년 2월 27일
I recommend going through the "Importing Signal Data in Simulink" section of the doc:
Depending on your task, the table "Guidelines for Specifying Time and Signal Values for Imported Data" will help you implementing the most appropriate method.
  댓글 수: 1
charanarur panem
charanarur panem 2018년 7월 9일
please help for the workspace simulink problem.Actaully i gave input 100x50 data,but workspaceoutput shows 1100x50,please tell me how to get 100x50 data matrix

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

카테고리

Help CenterFile Exchange에서 Naming Conventions에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by