How to plot ScopeData from Simulink into GUI
    5 visualizzazioni (ultimi 30 giorni)
  
       Mostra commenti meno recenti
    
    Joe Fleming
 il 20 Set 2016
  
    
    
    
    
    Risposto: Jasmine Poppick
    
 il 26 Apr 2024
            Simulating my model using
 evalin('base','sim(''Gen_Diff_Model_2'')')
to bring the variable ScopeData1 to the base workspace. However when plotting the data using:
    function Plot_Callback(hObject, eventdata, handles)
    axes(handles.HV_Measurement);
    plot(ScopeData1.time, ScopeData1.signals.values)
I receive: "Undefined function or variable 'ScopeData1'."
Thanks
0 Commenti
Risposta accettata
  Geoff Hayes
      
      
 il 20 Set 2016
        Joe - since the ScopeData1 is in the base workspace, then you would need to use evalin from within your GUI to grab this data. For example,
 function Plot_Callback(hObject, eventdata, handles)
 axes(handles.HV_Measurement);
 timeData   = evalin('base','ScopeData1.time');
 signalData = evalin('base','ScopeData1.signals.values');
 plot(timeData, signalData);
Più risposte (1)
  Jasmine Poppick
    
 il 26 Apr 2024
        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.
0 Commenti
Vedere anche
Categorie
				Scopri di più su Develop Apps Using App Designer in Help Center e File Exchange
			
	Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!



