Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations TugboatEng 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
Joined
Oct 23, 2005
Messages
2
Location
US
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
 
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

Back
Top