whats wrong with my code?
2 vues (au cours des 30 derniers jours)
Afficher commentaires plus anciens
Shangeetha Mahendran
le 3 Déc 2018
Commenté : Shangeetha Mahendran
le 4 Déc 2018
function ped1
sol =pdepe(m,@pdefun,@pdeic,@pdebc,xmesh,tspan);
u=sol(:,:,1);
function [c,f,s]= pdefun(x,t,u,DuDx)
c = V/D;
f = DuDx;
s=0;
end
ped1
Undefined function or variable 'V'.
Error in pdefun (line 2)
c = V/D;
Error in pdepe (line 246)
[c,f,s] = feval(pde,xi(1),t(1),U,Ux,varargin{:});
Error in ped1 (line 27)
sol =pdepe(m,@pdefun,@pdeic,@pdebc,xmesh,tspan);
2 commentaires
Réponse acceptée
Stephen23
le 3 Déc 2018
Modifié(e) : Stephen23
le 3 Déc 2018
function ped1()
...
V = ...
D = ...
R = ...
...
function [...]= pdefun(...)
...
V/D
...
end
function [...] = pdebc(...)
...
end
end
5 commentaires
Stephen23
le 4 Déc 2018
Modifié(e) : Stephen23
le 4 Déc 2018
"in pdefun; is that possible to use array for the term "c" nstead of constant?"
MATLAB does not have any "constant" class, so it is not clear what you mean. Perhaps you mean that c is scalar?
In any case, the pdepe help states the the first output c should be a column vector. Given that both V and D are scalars, it is not clear what you expect c to be. Please show an example.
Plus de réponses (0)
Voir également
Catégories
En savoir plus sur Eigenvalue Problems dans Help Center et File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!