Bonjour,


Je débute dans Matlab et j'ai une question de débutant:

A partir d'une figure principale, j'appelle l'ouverture d'une figure secondaire si l'on presse sur un bouton poussoir:

Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7
8
9
10
 
% --- Executes on button press in curvature_button.
function curvature_button_Callback(hObject, eventdata, handles)
% hObject    handle to curvature_button (see GCBO)
% eventdata  reserved - to be defined in a future version of MATLAB
% handles    structure with handles and user data (see GUIDATA)
global theta;
global radius;
 
open curvature_window.fig;
Dans le code M de la nouvelle figure, je cherche à mettre à jour un graphique existant dont je connais le handle: (dernière ligne du code ci-dessous)

Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
 
% --- Executes on button press in maj_graphe_curv.
function maj_graphe_curv_Callback(hObject, eventdata, handles)
% hObject    handle to maj_graphe_curv (see GCBO)
% eventdata  reserved - to be defined in a future version of MATLAB
% handles    structure with handles and user data (see GUIDATA)
global theta;
global radius;
 
h=0.01;
t=0:h:pi;
delta=spline(theta,radius,t);
dtheta=diff(delta)/h;
n=size(t,2);
t_d=t(:,1:n-1);
plot(handles.curvature_graph,t_d,dtheta);
j'obtiens alors les messages d'erreur suivants:

??? Attempt to reference field of non-structure array.

Error in ==> curvature_window>maj_graphe_curv_Callback at 101
plot(handles.curvature_graph,t_d,dtheta);

Error in ==> gui_mainfcn at 96
feval(varargin{:});

Error in ==> curvature_window at 42
gui_mainfcn(gui_State, varargin{:});

Error in ==> @(hObject,eventdata)curvature_window('maj_graphe_curv_Callback',hObject,eventdata,guidata(hObject))


??? Error while evaluating uicontrol Callback
De quoi cela provient-il ? Par avance, merci.

Luis