How to pass data from Edit Text Box in GUI to Constant Block in Simulink?
1 回表示 (過去 30 日間)
古いコメントを表示
Hi everyone..
I have a GUI and Simulink (from Simmechanics), and I want to import a data from Edit Text Box in GUI to Constant Block in Simulink. But I don't know how to make it. Is there anyone who can help me?
Thankyou for your attention...
0 件のコメント
採用された回答
Sachin Ganjare
2012 年 10 月 18 日
Refer below link:
Hope it helps!!!
2 件のコメント
Sachin Ganjare
2012 年 10 月 18 日
Use 'assignin' function in GUI function callback for updating value of variable that is used in constant block.
その他の回答 (2 件)
Azzi Abdelmalek
2012 年 10 月 20 日
編集済み: Azzi Abdelmalek
2012 年 10 月 20 日
c=10
set_param('yourmodelname/Constant','value',num2str(c))
%yourmodelname is your simulink model name
9 件のコメント
Mina As
2016 年 5 月 21 日
I have sine wave block instead of constant block how can i update the values of amplitude and frequency in gui with simulink?
CHHLONH Chhith
2018 年 3 月 30 日
編集済み: CHHLONH Chhith
2018 年 3 月 30 日
@ Azzi Abdelmalek
I used your command:
c=10
set_param('yourmodelname/Constant','value',num2str(c))
but it does not work with step block. Do you know the command for step block. thanks
el khatabi el mahdi
2016 年 6 月 9 日
hellos everyone . I am now working on a project that is the regulation of the temperautre and humidity with the help of the Arduino + DHT11 sensor and Simulink , I connected a script matlab in series with the Arduino software to extract values humidity and temperature to plots them in a graph. I'd like to display these values in Simulik for the regulation of these values ,I got Many problem at the declaration of set- param function here is the matlab code (exmeple Tepmerature ): global Temp ; Temp(i) = str2num(out(1:4));
set_param('DHT11SIM/Temperature','value',num2str(Temp))
set_param('DHT11SIM', 'Temperature', 'update')
subplot(211); plot(Temp,'g'); axis([0,temps,20,50]); title('DHT11 Température'); xlabel('---> temps (secondes)'); ylabel('---> Température'); grid
code simulink:
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/174449/image.png)
here is the erruer that always receives: Error using DHT (line 15) Invalid Simulink object name: DHT11SIM/Temperature .
please Help me
0 件のコメント
参考
カテゴリ
Help Center および File Exchange で Simscape Multibody についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!