Error setting property 'String' of class 'UIControl' method lin bairstow
Mostrar comentarios más antiguos
Hello! How are you. As you can see in the image, the matlab throws me an error in my script then I leave the code to tell me what's wrong with me, please I took a little time in Matlab and I really do not know how to solve this problem. i'm working in gui of matlab
% --- Executes on button press in pushbutton1. function pushbutton1_Callback(hObject, eventdata, handles)
a=zeros(1,7);
b=zeros(1,7);
c=zeros(1,7);
a(1,3)=str2double(get(handles.edit2,'string'));
a(1,4)=str2double(get(handles.edit3,'string'));
a(1,5)=str2double(get(handles.edit4,'string'));
a(1,6)=str2double(get(handles.edit5,'string'));
a(1,7)=str2double(get(handles.edit6,'string'));
r=str2double(get(handles.edit13,'string'));
s=str2double(get(handles.edit12,'string'));
ciclos=str2double(get(handles.edit11,'string'));
for k=1:1:ciclos
syms dr ds; for i=3:1:7 b(1,i)=a(1,i)+r*b(1,i-1)+s*b(1,i-2); end
for j=3:1:7
c(1,j)=b(1,j)+r*c(1,j-1)+s*c(1,j-2);
end
E1=c(1,5)*dr+c(1,4)*ds==-b(1,6);
E2=c(1,6)*dr+c(1,5)*ds==-b(1,7);
[dr,ds]=(solve(E1,E2));
B=b;
C=c;
Deltas=[vpa(dr,4),vpa(ds,4)];
r=r+dr;
s=s+ds;
end
vpa(r,5);
vpa(s,5);
vpa(dr,4);
vpa(ds,4);
set(handles.edit7,'string',r);
set(handles.edit8,'string',s);
set(handles.edit9,'string',dr);
set(handles.edit10,'string',ds);
% --- Executes on button press in pushbutton2.

Respuesta aceptada
Más respuestas (1)
Steven Lord
el 2 de Nov. de 2017
0 votos
You can't set the String property of a UIControl to contain a symbolic expression directly. Either convert the symbolic expression to a numeric array using double (this will NOT work if the expression contains a symbolic variable) or convert it into a char vector using char and set the result as the value of the String property.
1 comentario
Erwin Avendaño
el 2 de Nov. de 2017
Categorías
Más información sobre Assumptions en Centro de ayuda y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!