Enter input value interactively in Matlab

I would like to be able to enter a value interactively in Matlab. However, I am also using the "Matlab Function" block in my Simulink model. This block only takes scalar input. I know how to use "From Workspace" to enter the input but it has be a vector. How can I get around if I want to keep the "Matlab Funciton" block in my Simulink model.
Thanks in advance

답변 (1개)

Image Analyst
Image Analyst 2014년 4월 15일

0 개 추천

I don't know Simulink, but if it can run MATLAB code, why not just call inputdlg() to pop up a dialog box that asks the user to input some values?

댓글 수: 5

Image Analyst
Image Analyst 2014년 4월 15일
By the way, why did you list the Coder product instead of Simulink?
William
William 2014년 4월 16일
How could I use this input value from inputdlg for my input in the Simulink model? Since I am using "Matlab Fctn" block in the model, it only accepts scalr input. I tried to use "From Workspace" block but it only takes vector input.
William
William 2014년 4월 16일
I am using both Matlab & Simulink product for the model.
Image Analyst
Image Analyst 2014년 4월 16일
I don't know - I don't have Simulink. But I think I've heard that Simulink users can run MATLAB chunks of code. Perhaps the training documents for Simulink will show you how.
I'll removed Coder (which builds C programs from MATLAB code), and add Simulink to the product list.
William
William 2014년 4월 17일
I updated my product o Simulink.

이 질문은 마감되었습니다.

제품

질문:

2014년 4월 15일

마감:

2021년 8월 20일

Community Treasure Hunt

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

Start Hunting!

Translated by