Simulink block from workspace

3 visualizaciones (últimos 30 días)
dd123
dd123 el 8 de Nov. de 2011
Comentada: charanarur panem el 9 de Jul. de 2018
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?

Respuestas (2)

Fangjun Jiang
Fangjun Jiang el 8 de Nov. de 2011
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 comentarios
Fangjun Jiang
Fangjun Jiang el 9 de Nov. de 2011
What do you get if you run size(t) and size(y)? Is the data in t strictly incremental?
dd123
dd123 el 5 de Dic. de 2011
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'.

Iniciar sesión para comentar.


Guy Rouleau
Guy Rouleau el 9 de Nov. de 2011
Editada: John Kelly el 27 de Feb. de 2015
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 comentario
charanarur panem
charanarur panem el 9 de Jul. de 2018
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

Iniciar sesión para comentar.

Categorías

Más información sobre Naming Conventions en Help Center y File Exchange.

Community Treasure Hunt

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

Start Hunting!

Translated by