Optimize code with live plots
8 visualizzazioni (ultimi 30 giorni)
Mostra commenti meno recenti
Hello everyone,
I am trying to optimize my code in order to reduce the time it takes to compute. Basically my script is running within a WHILE loop, and inside this loop are multiple calculations and plots being made. However, I would like to know how can I simplify this following code for example:
axes(handles.axes9);
scatter(xmatrix, ymatrix, [], pressure);
colorbar;
hold on;
set(handles.axes9, 'XTick', [], 'YTick', [], 'color', 'k', 'box', 'off');
axis equal;
plot(xmatrix(position), ymatrix(position), 'or', 'MarkerFaceColor', 'w', 'MarkerSize', 8, 'LineWidth', 2);
hold off;
It does what I want it to do, but everytime the whole scatter plot is being redrawn. How can I isolate it outside my WHILE loop but still update the same axes with the PLOT function shown above? The "position" variable is also calculated inside the loop if that can help.
Cheers!
0 Commenti
Risposte (0)
Vedere anche
Categorie
Scopri di più su Surrogate Optimization 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!