Error: Not enough arguments.
Show older comments
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
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;
Answers (1)
KSSV
on 30 Apr 2020
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) ;
Categories
Find more on PDE Solvers 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!