why do I get this "Matrix dimensions must agree" error ?
Show older comments
Hi there
every time I ran this code and chose another item of listbox rather than the first item, I see this :
Matrix dimensions must agree.
Error in testp>ButtonPushed (line 17)
if a=='Bisection'
please help !
my code :
function v
fig = uifigure;
tg = uitabgroup(fig,'Position',[190 150 200 200]);
t = uitab(tg,'Title','input information');
bb = uieditfield(t,'text','Position',[11 145 150 22],'Value','input function like: x.^2');
dd = uidropdown(t,'Position',[11 90 150 22],'Items',{'Bisection','false position','Newton & Rophson'...
'Secant'});
t.Scrollable = 'on';
btn = uibutton(fig,'push',...
'Position',[11 40 140 22],'Text','start',...
'ButtonPushedFcn', @(btn,event) ButtonPushed(btn,dd));
end
function ButtonPushed(btn,dd)
a=dd.Value;
if a=='Bisection'
xl=input('xl ra vared konid = ');
xu=input('xu ra vared konid = ');
Bisection(xl,xu)
elseif a=='false position'
xl=input('xl ra vared konid = ');
xu=input('xu ra vared konid = ');
Nabejaee(xln,xu)
elseif a=='Newton & Rophson'
xi=input('xi ra vared konid = ');
L=input('karan paeen tabe jahat rasm ra vared konid = ');
U=input('karan balaye tabe jahat rasm ra vared konid = ');
Newton_Rophson(xi,L,U)
elseif a=='Secant'
xi_old=input('xi-1 ra vared konid = ');
xi=input('xi ra vared konid = ');
L=input('karan paeen tabe jahat rasm ra vared konid = ');
U=input('karan balaye tabe jahat rasm ra vared konid = ');
Secant_m(xi_old,xi,L,U)
end
end
Accepted Answer
More Answers (0)
Categories
Find more on Logical in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!