How to use a while to stock data in a table.

1 view (last 30 days)
Hello, i want to know how i can stock datas in table mean while i'm using a while. In the table only the last data appears.
function BtnCalcular_Callback(hObject, eventdata, handles)
syms x;
Funcion=get(handles.EtxtFuncion,'String');
A=str2double(get(handles.EtxtInterA,'String'));
B=str2double(get(handles.EtxtInterB,'String'));
Tol=str2double(get(handles.EtxtTol,'String'));
e=100;
n=1;
while e>=Tol
Xr=(A+B)/2;
e=Xr-A;
fXr = double(subs(Funcion,x,Xr));
fXa = double(subs(Funcion,x,A));
sig=(fXr)*(fXa);
T=[A B Xr e sig];
set(handles.Tabla,'data',T);
if sig>=0
A=Xr;
else
B=Xr;
end
end
set(handles.ResRaiz,'String',num2str(A));

Answers (0)

Categories

Find more on Tables in Help Center and File Exchange

Tags

Community Treasure Hunt

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

Start Hunting!