Plots graph from simulink scope to App Designer for MATLAB R2019a

I have an error using evalin command to plot simulink scope in UI axes - app designer MATLAB R2019a. How to solve this?

回答 (2 件)

Pujitha Narra
Pujitha Narra 2019 年 11 月 11 日

0 投票

Hi Nur,
I am not sure what the error is, but you can look at a similar query here:
Hope it helps!

6 件のコメント

Nur Huda Mohd Amin
Nur Huda Mohd Amin 2019 年 11 月 13 日
Thank you. I have opened the link but did not solved my problem.
The code below I have generate in MATLAB R2009b and the graph display in GUI;
switch popupmenu1value
case 'PLOT 1'
simout = evalin('base','simout');
axes(handles.VVaxes1)
plot(simout.Time,simout.Data(:,1),'r','LineWidth',2)
xlabel('')
ylabel('Voltage[V]')
but, when I generate the code in 2019a the graph did not display and error in app designer. I have to use MATLAB R2019a for supporting Arduino Nano 3.0 board.
Actually, I have tried this code below but still did not display the graph and error in app designer;
switch app.PLOTSOPTIONSDropDown.Value
case 'LIVE PLOTS'
out = evalin('base',Output);
app.PLOTSOPTIONSDropDown.Value = 'LIVE PLOTS';
app.UIAxes_1
plot(app.UIAxes_1,evalin('base',out.Output.Time),evalin('base',out.Output.Data(:,1)),'c','LineWidth',2)
Pujitha Narra
Pujitha Narra 2019 年 11 月 14 日
Hey,
Can you provide the error message that you received?
Nur Huda Mohd Amin
Nur Huda Mohd Amin 2019 年 11 月 15 日
I have attached .pdf for the error message. Hopefully you have the solution for my problems. Thank you.
Pujitha Narra
Pujitha Narra 2019 年 11 月 18 日
Hi again!
I don't think the problem is with the 'evalin' function. For some reason, the variable 'Output' is not recognized i.e it is not in the workspace you are working in. Can you make sure you have it in your workspace and check if the error persists? Also which block are you using for 'Output' in the model?
Nur Huda Mohd Amin
Nur Huda Mohd Amin 2019 年 11 月 20 日
Refer to the attachment given. Thank you.
saleh said bouhliga
saleh said bouhliga 2020 年 10 月 16 日
hi
Solution to your question see here
https://se.mathworks.com/matlabcentral/fileexchange/73613-interface-between-matlab-app-and-simulink?s_tid=answers_rc2-1_p4_Topic

サインインしてコメントする。

Jasmine Poppick
Jasmine Poppick 2024 年 4 月 26 日

0 投票

Starting in R2024a, you can use App Designer to interactively create an app for a Simulink model, which includes the capability to easily and performantly visualize signal data in the app using the new time scope UI component.
In addition, you can:
  • Add UI components configured specifically to interact with your model, such as a simulation start/stop control and a simulation progress bar.
  • Tune model variables from the app while the simulation runs by connecting UI components to variables.
For more information, see Create App for Simulink Model.

カテゴリ

ヘルプ センター および File ExchangeDevelop Apps Using App Designer についてさらに検索

質問済み:

2019 年 11 月 8 日

回答済み:

2024 年 4 月 26 日

Community Treasure Hunt

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

Start Hunting!

Translated by