I'm trying to create a GUI with 2 axes but i'm having some problems. Outside the gui, the line runs just fine.
Here is my code and the error:
'''
function pushbutton1_Callback(hObject, eventdata, handles)p=60; %iterações
aR=str2num(char(get(handles.edit1,'String')));pR=str2num(char(get(handles.edit2,'String')));aJ=str2num(char(get(handles.edit3,'String')));pJ=str2num(char(get(handles.edit4,'String')));R=zeros(1,p);R(1) = 0.1;J=zeros(1,p);J(1) = 0.1;for i = 2:p R(i)= (aR*R(i-1) + pR*J(i-1)); J(i)= (aJ*J(i-1) + pJ*R(i-1));endaxes(handles.axes1);plot(R,'Marker','o','MarkerFaceColor','b' );hold on;plot(J,'Marker','o','MarkerFaceColor','g' );axes(handles.axes2);plot(R,J,'Marker','o','MarkerFaceColor','b' );
'''
And returns the error:
"In an assignment A(I) = B, the number of elements in B and I must be the same.Error in Analise2Var>pushbutton1_Callback (line 94) R(i)= (aR*R(i-1) + pR*J(i-1));"
Best Answer