Creat Signal in Simulink

조회 수: 5 (최근 30일)
Pham Van Dung
Pham Van Dung 2012년 8월 24일
Dear,
I have a signal that i have saved in my workspace with the name is Matlab.mat This is my result of the previous simulation.
Now,I want to use this file to creat a signal for another simulation. How can i do it? If you have another methods to creat this signal? please help me!
Thanks with best regard!
Pham Van Dung

채택된 답변

Azzi Abdelmalek
Azzi Abdelmalek 2012년 8월 24일
  1. your file matlab.m must contains the time t and the signal y (for example)
  2. i don't know how you saved your signal
  3. if your signal y and time t are 1xn array
ty=[t;y]
save matlab ty
% then in simulink, from sources, use "from file" and set the name of your file "matlab"
  댓글 수: 2
Pham Van Dung
Pham Van Dung 2012년 8월 28일
Thanks for your helping! I have load my signal in workspace already! 1. My file also contains T and Y axes! 2. In scope Parameter ---> Data History---> save the data in workspace 3. It's also an array. But Now i got a new problem! My signal is continuosly and now i want to use this signal in discrete system. How can i solve this problem? Thanks with best regard!
Pham Van Dung
Azzi Abdelmalek
Azzi Abdelmalek 2012년 8월 28일
what do you mean?

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

추가 답변 (1개)

Mariano Lizarraga
Mariano Lizarraga 2012년 8월 25일
You need to post a little bit more information about how the data from the first simulation are saved.
Supposing that you have in Matlab.mat in the workspace and that it contains the two things you need to use: the time vector and the signal data, then you can use the "From Workspace" block to make that signal available in Simulink: http://skit.ch/nwnt
A few things to consider: Although not strictly necessary, it is better if you make sure that the sample time in your "From Workspace" block is the same as the time vector in your source signal. Also if your second model will run longer than the data set you got from the first simulation, decide what behavior you want on the "From Workspace" block after the time vector reaches its end; you can either set the output to zero, cycle over, hold the final value or extrapolate it.
  댓글 수: 1
Mariano Lizarraga
Mariano Lizarraga 2012년 8월 27일
There is also a full Tech Note about how to do this: http://www.mathworks.com/support/tech-notes/1900/1902.html

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

카테고리

Help CenterFile Exchange에서 Model Verification에 대해 자세히 알아보기

태그

제품

Community Treasure Hunt

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

Start Hunting!

Translated by