Ode Eroor in GUI matlab....(Error using odearguments (line 90) @(X,Y)(VGU​I+WYGUI)./​(UGUI+WXGU​I) must return a column vector.)

1 view (last 30 days)
I am working on this project whic is about fluid kinematics in x an y axes and trying to set streamlines to the graph. I have
First, my all functions are handles like below, which takes data from gui edit box and defined like that below.
function ut = ug(handles, x, y)
ut = handles.edit11.String
evalc(ut)
My intend is to plot streamlines like the picture below,
streamlines= dy/dx=(ug+value of wxg)/(vg+value of wyg)
it means ug= 0.8x+05, value(wyg= 0); vg=1.5-0.8*y, wyg= 2.5*sin(w.t) value of wyg= -1,36 when t=5 and w =2
(ug+value of wxg)=0.8x+05+0
(vg+value of wyg)=1.5-0.8*y-1.36
so, my intend is dy/dx=(0.8x+05+0)/(1.5-0.8*y-1.36) but with the functions with ode 45 but ı got an error
ux, vx is a handle function refers ug(handles,x,y),vg(handles,x,y), all function is set to the edit text as a function
wx,wy is a handle function refers wxg(handles,w,t), wyg(handles,w,t) all function is set to the edit text as a function as below
WHEN I PUSH THE BUTTON I GOT ERROR, Main code is below.
MY FUNCTİON IS BELOW
function pushbutton1_Callback(hObject, eventdata, handles)
clc
hold off
axes(handles.axes1);
xilk=str2double(get(handles.edit5,'String'));
xson=str2double(get(handles.edit7,'String'));
yilk=str2double(get(handles.edit8,'String'));
yson=str2double(get(handles.edit9,'String'));
gl=str2double(get(handles.edit10,'String'));
w=str2double(get(handles.edit15,'String'));
t=str2double(get(handles.edit16,'String'));
set(gca, 'XLim', [xilk xson], 'YLim', [yilk yson]);
[x,y]=meshgrid(xilk:gl:xson,yilk:gl:yson);
ugui=eval(ug(handles,x,y));
vgui=eval(vg(handles,x,y));
wxgui=eval(wxg(handles,w,t));
wygui=eval(wyg(handles,w,t));
uu=(ugui)+(wxgui);
vv=(vgui)+(wygui);
quiver(x,y,uu,vv,1.3,'r','linewidth',2);
set(gca, 'XLim', [xilk xson], 'YLim', [yilk yson]);
hold on;
grid on;
%ERROR BEGİNS BELOW
for a=xilk:stgl:xson;
tspan = [a xson+1];
y0 = [yilk yson];
[xx,yy] = ode45(@(x,y) (vgui+wygui)./(ugui+wxgui), tspan, y0);
plot(xxr,yyr,'-k','linewidth',2);
hold on
end
İt gives error.
Error using odearguments (line 90)
@(X,Y)(VGUI+WYGUI)./(UGUI+WXGUI) must return a column vector.
Error in ode45 (line 113)
[neq, tspan, ntspan, next, t0, tfinal, tdir, y0, f0, odeArgs, odeFcn, ...
Error in FLUIDKNM>pushbutton1_Callback (line 267)
[xx,yy] = ode45(@(x,y) (vgui+wygui)./(ugui+wxgui), tspan, y0);
How can i fix this error, with this functions

Answers (0)

Community Treasure Hunt

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

Start Hunting!