0

Hi all,

I am a total mathlab newbie and hence am having trouble with even the simplest of things.

i have an m file which contains just the following 3 lines

% test func
function y = f1(x,c)
y = x*x - c

when i "run" this i get an error message

"??? Input argument 'x' is undefined.

Error in ==> C:\f1.m
On line 2 ==> y = x*x - c "

i have no clue why i am getting this.

any help would be really appreciated.

alnerdy

3
Contributors
3
Replies
4
Views
12 Years
Discussion Span
Last Post by hero_hont
0

problem solved.

need i say i am dumb.

once f1.m is created, one needs to only call the function as so
f1(10,2) and viola .... matlab spits stuff out.

-2

hello can u plz explicitly explain ur correctio cuz i cant get a similiar errror of mine.
thanks

Votes + Comments
Don't bump old threads
0

Hi all,

I am a total mathlab newbie and hence am having trouble with even the simplest of things.

i have an m file which contains just the following 3 lines

% test func
function y = f1(x,c)
y = x*x - c

when i "run" this i get an error message

"??? Input argument 'x' is undefined.

Error in ==> C:\f1.m
On line 2 ==> y = x*x - c "

i have no clue why i am getting this.

any help would be really appreciated.

alnerdy

hih you,,,,,,,,,,,,,,,
in the matlab, it understant about input "x"
"??? Input argument 'x' is undefined.

Error in ==> C:\f1.m
On line 2 ==> y = x*x - c "
because you have written code of input "x".
you can write as matrix..
run okkkkkkkkkkkk:)

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.