i just one pushbutton for calculate but i cant display. help me :'(

1 回表示 (過去 30 日間)
Nur Syafawani Mat Syet
Nur Syafawani Mat Syet 2018 年 11 月 28 日
回答済み: ES 2018 年 11 月 28 日
% --- Executes on button press in Calculate.
function Calculate_Callback(hObject, eventdata, handles)
% hObject handle to Calculate (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles structure with handles and user data (see GUIDATA)
%Newton Method
x = [0.1;0.1;-0.1];
n = 8 ;
Tol = 0.00000000001;
F1 = @F1;
J = @Jacob3x3;
for i=1 : n
Dx = -inv(J(x)) * F1(x);
xn = x + Dx;
if abs(F1(xn)) < Tol
break;
end;
x = xn;
fprintf('x:%.10f %.10f %.10f \n', x);
handles.solve.String = sprintf('x:%.10f %.10f %.10f \n', x);
end

回答 (1 件)

ES
ES 2018 年 11 月 28 日
Instead of
handles.solve.String = '...';
you have to use
set(handles.solve, 'String', '...')

カテゴリ

Help Center および File ExchangePhysics についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by