- your file matlab.m must contains the time t and the signal y (for example)
- i don't know how you saved your signal
- if your signal y and time t are 1xn array
Creat Signal in Simulink
1 次查看(过去 30 天)
显示 更早的评论
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
0 个评论
采纳的回答
Azzi Abdelmalek
2012-8-24
ty=[t;y]
save matlab ty
% then in simulink, from sources, use "from file" and set the name of your file "matlab"
更多回答(1 个)
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
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 Center 和 File Exchange 中查找有关 Model Verification 的更多信息
产品
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!