Plots via s-function
Mostra commenti meno recenti
Hello,
I've written a Level2 S-Function, that plots space vector diagramms during my Simulink simulations. This is working so far, but the problem is that the execution time of the s-function slows down my simulation due to the matlab interpreter.
So my question is, is there any way to create and modify matlab-figures with a mex S-Function? After a lot of searching, I could not find any commands for doing that.
Thank you for your help
Tobias Gemaßmer
Risposta accettata
Più risposte (3)
Titus Edelhofer
il 24 Nov 2011
Hi Tobias,
not really. What I would suggest is to reduce the sample time of the output so that the S-function (plotting) is not done every time step but e.g. every 10th step only ...
Second: how does the plotting work, do you redraw the entire plot every time step (plot(x,y)), or (preferably) do you store the handle of the plot in some work vector and do only update the line, something like
set(h, 'xdata', newXData, 'ydata', newYData);
This is usually significantly faster.
Titus
Tobias Gemaßmer
il 24 Nov 2011
0 voti
Tobias Gemaßmer
il 25 Nov 2011
0 voti
1 Commento
Titus Edelhofer
il 25 Nov 2011
Good to hear, so I guess the question might be seen as answered ...
Categorie
Scopri di più su Parallel Computing Toolbox in Centro assistenza e File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!