How to create an input signal from acquired data

조회 수: 4 (최근 30일)
Frederico
Frederico 2011년 3월 17일
Hi to all.
I want to create an input signal (wich I use to build with the 'Signal builder' block) from data I acquired. I have this data in a .xls and have already learned how to import it to the 'Workspace'.
Hope you can help me, Cheers

답변 (2개)

Laura Proctor
Laura Proctor 2011년 3월 18일
If your data is already defined in the workspace, then you may use Inport blocks found in the Sources Library to import each signal. Each signal must be a column-wise vector, and you must define the variables to import from the workspace in the Configuration Parameters (CTRL+E) > Data Import/Export Tab. Check the Input box and then add your input vectors. For example, if you have 3 input vectors defined in the workspace named u1, u2 and u3, your Input field would look like this: [t u1 u2 u3]. You may have all of your data in a matrix. In this case, each column represents a different input. If the matrix is named data, you would enter [t data] in the input field.
  댓글 수: 2
Frederico
Frederico 2011년 3월 18일
Hi Laura,first of all thanks for your help.
I could manage to make it work the way you told me.I tried with single vectors.
Is the 't' variable I'm importing giving now the time parameter for my simulation?Imagine my simulation would be running with a frequency of 10Hz, if now my 't' input has 50Hz this will be the new frequency of my simulation?
Laura Proctor
Laura Proctor 2011년 3월 18일
Your simulation frequency and time will be independent of your input frequency and time depending on the solver that you use and the time that you set for your simulation.

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


Guy Rouleau
Guy Rouleau 2011년 3월 18일
Laura's solution is one good approach.
If you want to import your data directly from Excel to the Signal Builder block, follow this example:
http://www.mathworks.com/help/toolbox/simulink/gs/bsmigir.html
  댓글 수: 1
Frederico
Frederico 2011년 3월 18일
Hi Guy,thanks for your answer.
There's no "Import" option under "File"...in the "Signal Builder".All I see is under File is Open,Save,Export,Export to Workspace,Simulation Options.I'm using Matlab R2008b

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

카테고리

Help CenterFile Exchange에서 Signal Import and Export에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by