Undefined function for input argument of type double
Afficher commentaires plus anciens
When i saved my code yesterday it was working fine but when i run it now, I am getting this error "Undefined function 'P' for input arguments of type 'double'". Why is that?
L=5100; delta_y=250; delta_z=30; Pini=3500; phi=0.2; k=10; ct=3*10^-5; B=1.25;mu=3; rw=0.25; qc=100; A=delta_z*delta_y; delta_t=10; delta_x=300;
X=150:300:4950; x=length(X);
T=1:10:100; t=length(T);
C1=158*phi*mu*ct/k;
for m=2:1:x-1
for n=1:1:t
P(m,n+1)=((-C1*delta_x^2*P(m,n)/delta_t)+C2*delta_x-P(m+1,n+1)-P(m-1,n+1))/-(2+C1*delta_x^2/delta_t);
end
end
plot (X,P(m,1),'*',X,P(m,6),'+',X,P(m,11),'x');
xlabel ('Distance');
ylabel ('Pressure');
title ('Symmetry Test');
disp (P(m,1)),
disp (P(m,6)),
disp (P(m,11)),
Réponse acceptée
Plus de réponses (1)
Chad Greene
le 6 Avr 2016
0 votes
Yesterday you most likely had a variable P that you were tinkering with, so when you ran the loop it was able to access actual values in P(m,n). But running the code you posted, P does not exist before you try to access values inside P.
Catégories
En savoir plus sur Logical dans Centre d'aide et File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!