Continue to Site

Eng-Tips is the largest engineering community on the Internet

Intelligent Work Forums for Engineering Professionals

  • Congratulations KootK on being selected by the Eng-Tips community for having the most helpful posts in the forums last week. Way to Go!

Input argument 'x' is undefined????

Status
Not open for further replies.

stluoustc

Computer
Oct 23, 2005
2
can anyone tell me why whenever I define a function like:

function c=g(x)
c=x^2;

after run and save
the system tells me:: ???Input argument 'x' is undefined

thanks
 
Replies continue below

Recommended for you

Are you running the function as if it was a script? You can't simply "run" a function like that, you have to "call" it.

In the matlab workspace type "answer = g(1.234)". Does it work now?

M

--
Dr Michael F Platten
 
yup, I understand now,,, thanks

I'm a new learner,,,,,,,,so,,,,,,,
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor