Signal generator from .m file to simulink

2 ビュー (過去 30 日間)
deMonako
deMonako 2021 年 3 月 13 日
回答済み: Sergey Kasyanov 2021 年 3 月 13 日
Hi,
I have formula in .m file:
Q_di = 2;
omega_di = 3;
t = 0:0.1:30;
q_di=Q_di*sin(omega_di*t);
plot(t,q_di)
now i am trying to put this in simulink (to show this on scope). I want something working like simulink block Signal Generator, that generates signal depending on simulation time (not on my t array). I know this is sin func and i could put this straight into sin generator but i really need to have formula in .m file (vector in workspace) not only in simulink block.
I tried this as an output of my matlab func, but scope showed 300 different signals, and it didn't worked for
q_di'
Thanks, for helping

採用された回答

Sergey Kasyanov
Sergey Kasyanov 2021 年 3 月 13 日
Hello,
you can use From Workspace block with [t', q_di'] as Data parameter.

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeSources についてさらに検索

製品


リリース

R2018b

Community Treasure Hunt

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

Start Hunting!

Translated by