un coup d'oeil à demo_uicontrol.m qui a tout ce que vous avez besoin:
Un exemple dépouillé pour ce que vous avez demandé "curseurs près de mon complot"
## Useful since Octave 4.0
close all
clear h
graphics_toolkit qt
h.ax = axes ("position", [0.05 0.42 0.5 0.5]);
function update_plot (obj, init = false)
## gcbo holds the handle of the control
h = guidata (obj);
a = get (h.slider1, "value");
w = get (h.slider2, "value");
x = linspace (0, 3);
y = a * sin (x * 5 * w);
if (init)
h.plot = plot (x, y, "b");
else
set (h.plot, "xdata", x);
set (h.plot, "ydata", y);
endif
guidata (obj, h);
endfunction
h.slider1 = uicontrol ("style", "slider",
"units", "normalized",
"string", "slider",
"callback", @update_plot,
"value", 0.4,
"position", [0.05 0.25 0.35 0.06]);
h.slider2 = uicontrol ("style", "slider",
"units", "normalized",
"string", "slider",
"callback", @update_plot,
"value", 0.7,
"position", [0.05 0.15 0.35 0.06]);
set (gcf, "color", get(0, "defaultuicontrolbackgroundcolor"))
guidata (gcf, h)
update_plot (gcf, true);
On dirait que vous avez besoin d'une interface graphique - est-ce que octave a une fonctionnalité 'GUIDE'? – etmuse