필터 지우기
필터 지우기

Could I use Simulink to generate signal to test Matlab code?

조회 수: 1 (최근 30일)
Chen Kevin
Chen Kevin 2020년 4월 19일
댓글: Ameer Hamza 2020년 4월 19일
Hi all,
I am fresh to use matlab, so I want to know if I can use Simulink to generate signal for me to test my analysis tools programmed by matlab recently.
Because it is quite time consuming for me to make a demanding signal with matlab...
In this mean time of COVID-19 caused home-office situation, no instruments (e.g. function generator or real experiment) besides me so I'm considering maybe Simulink can do a little bit replacement of them.
  댓글 수: 2
Ameer Hamza
Ameer Hamza 2020년 4월 19일
What type of signal do you want to make in Simulink? Is it described by a mathematical formula, differential equations?
Chen Kevin
Chen Kevin 2020년 4월 19일
Hi Ameer good to see you,
For example, basic sine wave, pulse or maybe amiplitude varying sine waves and pulses

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

채택된 답변

Ameer Hamza
Ameer Hamza 2020년 4월 19일
The attached file (saved in R2020a) shows how to generate different types of signals in Simulink and export them to MATLAB's workspace. It uses 'To Workspace' blocks to send data from Simulink to MATLAB. You can plot these signals in MATLAB by using the 'out' struct given by the Simulink. For example,
plot(out.varAmpFreqSine)
  댓글 수: 4
Chen Kevin
Chen Kevin 2020년 4월 19일
편집: Chen Kevin 2020년 4월 19일
Thanks!
To conclude, what I to have do is to use Simulink to generate signal, export it to the Matlab workspace and test my algorithm such as max value detection that you answered to me last time, am I right?
Ameer Hamza
Ameer Hamza 2020년 4월 19일
Yes, this workflow seems correct.

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

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Test Execution에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by