Error: Not enough arguments.
显示 更早的评论
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
function [c,f,s] = pdefun(x,t,u,dudx)
c = [2.94;2.97];
f = [-4.72; -8.32].* dudx;
y = (u(1) - u(2));
F = y;
s = [-F; F];
end
function uo = pdeic(x)
u(0) =[288;288];
end
function[pl,ql,pr,qr] = pdebc(xl,ul,xr, ur, t)
pl = [ul(1)-383; ul(2)-293];
ql = [0;0];
pr = [ur(1)-317.498; ur(2)-311.57];
qr = [0;0];
x = [ 0 0.005 0.01 0.05 0.1 0.2 0.5 0.7 0.9 0.95 0.99 0.995 1];
t = [0 0.005 0.01 0.05 0.1 0.5 1 1.5 2];
m = 0;
sol = pdepe(m,@pdefun,@pdeic, @pdebc,x,t);
u1 = sol(:,:,1);
u1 = sol(:,:,1);
end
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
Getting error as:
Not enough input arguments.
Error in fun (line 4)
f = [-4.72; -8.32].* dudx;
回答(1 个)
KSSV
2020-4-30
Dont run the function directly using F5 or the run button. Call them by giving inputs. Like:
x = yourvalue ;
t = your value ;
u = yourvalue;
dudx = your value ;
[c,f,s] = pdefun(x,t,u,dudx) ;
类别
在 帮助中心 和 File Exchange 中查找有关 PDE Solvers 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!