Undefined function or method 'debit' for input arguments of type 'double'.

1 次查看(过去 30 天)
Hi am using matlab(R2007a) version.
I created a function and when I try to run it I have this Error shown up
Undefined function or method 'debit' for input arguments of type 'double'.
Here is the function am talking about
function q=debit(i)
T=117;
Tm=30;
for i=0:5:T
if 0<=i<Tm
q=49.56*(i/2.79)^2;
elseif Tm<i<T
q=49.56*(8.37*i/5.58)^3;
end;
end;
can anybody help me please?

回答(1 个)

Image Analyst
Image Analyst 2015-4-2
How are you calling debit? Green "run" arrow/triangle on tool ribbon, F5 key, or typing something on the command line? What are you passing in for i? And why are you even passing in anything for i when you just redefine it as the loop index in a "for" loop? You never even do anything with the i that you passed in.
  2 个评论
Image Analyst
Image Analyst 2015-4-3
It wasn't really an "Answer" so much as questions. Questions to clarify your situation so people can figure out what you did and how to correct it so that everything will work for you as intended.

请先登录,再进行评论。

类别

Help CenterFile Exchange 中查找有关 Loops and Conditional Statements 的更多信息

标签

Community Treasure Hunt

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

Start Hunting!

Translated by