how do i regenerate my plot by defining start time and end time(x-axis of my plot) in matlab gui?

I have new to matlab. I have gui where I plot data.Now I want to use two edit buttons where I define my start time in one and end time in the other.Based on these 2 points,I want to replot my graph using a push button. Any help will be appreciated.

 Réponse acceptée

Try looking at these functions: cla(), plot(), xlim(), get(). Something like
cla; % Clear existing graph.
x1 = str2double(get(handles.editX1, 'string'));
x2 = str2double(get(handles.editX2, 'string'));
y = some equation using x, x1, and x2.
plot(x, y, 'b-');
xlim(x1, x2);
grid on;

Plus de réponses (0)

Catégories

En savoir plus sur Graphics Performance dans Centre d'aide et File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by