필터 지우기
필터 지우기

Error setting property 'String' of class 'UIControl' method lin bairstow

조회 수: 11 (최근 30일)
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.

채택된 답변

Erwin Avendaño
Erwin Avendaño 2017년 11월 3일
I'll try it later, the way I solved it is that the system of equations solved it with matrices (gauss jordan) and did not use the solve command for the system of equations. Thank you for answered

추가 답변 (1개)

Steven Lord
Steven Lord 2017년 11월 2일
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
Erwin Avendaño
Erwin Avendaño 2017년 11월 2일
I'll try it later, the way I solved it is that the system of equations solved it with matrices (gauss jordan) and did not use the solve command for the system of equations. Thank you for answered

댓글을 달려면 로그인하십시오.

카테고리

Help CenterFile Exchange에서 Calculus에 대해 자세히 알아보기

태그

Community Treasure Hunt

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

Start Hunting!

Translated by