Oct 23, 2005 #1 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
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
Oct 24, 2005 #2 MikeyP Aerospace Joined Mar 5, 2002 Messages 940 Location GB 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 Upvote 0 Downvote
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
Oct 24, 2005 Thread starter #3 stluoustc Computer Joined Oct 23, 2005 Messages 2 Location US yup, I understand now,,, thanks I'm a new learner,,,,,,,,so,,,,,,, Upvote 0 Downvote