Optimize code with live plots

2 visualizaciones (últimos 30 días)
Matt
Matt el 8 de Dic. de 2014
Editada: Matt el 8 de Dic. de 2014
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!

Respuestas (0)

Categorías

Más información sobre Surrogate Optimization en Help Center y File Exchange.

Community Treasure Hunt

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

Start Hunting!

Translated by