How can i connect simulink and matlab together?
37 ビュー (過去 30 日間)
古いコメントを表示
hi,
in my matlab code the Parameters K1, K2, K3, K4, K5 and K6 should be calculated from the given variables. The matlab code is just a function which is calculating the Parameters / Gains. I have a simulink file (attached in Photo) and as i said, the matlab code calculates the Gains(K1 to K6). I want to have the programm so, that when i run it, the gains(K1 to K6) will be directly read from the matlab code which i have alredy written and calculated the gains.
My question is, how can i connect the simulink and matlab code together?
I appreciate the answers.
Regards,
Pooria
0 件のコメント
回答 (2 件)
Naman Chaturvedi
2019 年 1 月 21 日
The variables K1-K6 should just be present in the base workspace and Simulink will pull the values from there. If you have a function that is assigning values to the variables, make sure you are returning the values to the base workspace.
Hope this helps.
参考
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!