Does my code have an error?
Ältere Kommentare anzeigen
Matlab works fine but when I do an executable file this button does not work in my program is the only one that does not work is the one with the longest code I can not understand because it is the only button that does not work when I convert it to executable file. I repeat in matlab if the code of this button works and it does not mark error but when I use this button in the ejectable it does not work
function pushbutton3_Callback(~, ~, handles)
syms x %variable simbolica x
f=get(handles.edit8,'string');
xl=str2double(get(handles.edit3,'string'));
xu=str2double(get(handles.edit5,'string'));
tol=str2double(get(handles.edit4,'string'));
E=100;
xa=100;
i=0;
while(tol<E)
xr=(xl+xu)/2;
fxl=subs(f,x,xl);
fxr=subs(f,x,xr);
m=fxl*fxr;
if(m)<0
xu=xr;
else
xl=xr;
end
E=abs(xr-xa);
xa=xr;
i=i+1;
end
xr;
vpa(E,5)
set(handles.edit6,'string',xr);
set(handles.edit9,'string',E);
% --- Executes on button press in pushbutton4.
Akzeptierte Antwort
Weitere Antworten (0)
Kategorien
Mehr zu Adding custom doc finden Sie in Hilfe-Center und File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!