Matlab path and undefined function

6 次查看(过去 30 天)
Nimco
Nimco 2012-8-14
Hi
I have tried several times to set Matlab path, my work is saved in the Matlab folder and I have added this folder and saved. File -> Set Path... -> Add Folder... -> Save. When I type >>addpath 'c:\mfiles' in the command space I get a message Warning: Name is nonexistent or not a directory: c:\mfiles.
I am still getting the error message
??? Input argument "y" is undefined.
Error in ==> trombe11 at 14
Tf1 =((y-b)-s1/Uc)*exp(-Ac*Uc*F/(m*cp))+(b+s1/Uc);
My mfile program:
function [dy] = trombe11(t,y )
Ac=0.2014;
Ar=2.2;
Aw=0.32;
Uc=3.1;
Uw=5.68;
Ut=1.03;
rho=1.23;
m =0.01353;
cp=1.003;
F=0.83;
b=8;
s1=15.68;
Tf1 =((y-b)-s1/Uc)*exp(-Ac*Uc*F/(m*cp))+(b+s1/Uc);
dy(1)=((Tf1-y)*0.011)/3.96 -((Ut*Ar+Uw*Aw)*(y-b)/(rho*cp*3.96));
Any help will be much appreciated.

回答(1 个)

Wayne King
Wayne King 2012-8-14
I was the one who answered your other post
You should not start a new thread. This the same question.
I just used 'c:\mfiles' as an example. I don't know your computer and I have no idea where you have saved trombe11.m
If you enter
>>which trombe11
at the command line what is returned?
  1 个评论
Matt Fig
Matt Fig 2012-8-15
If the OP is getting that error, finding trombe11 is not the problem. Calling it is.
So, to the OP: How are you calling this function and did you show the entire error message?

请先登录,再进行评论。

类别

Help CenterFile Exchange 中查找有关 Environment and Settings 的更多信息

Community Treasure Hunt

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

Start Hunting!

Translated by