Why am I getting undefined variable error?

 Accepted Answer

Adam
Adam on 13 Mar 2017
How are you calling your function? If you are just clicking the big green 'Run' at the top then of course you will get this error. Your function takes 'x' as an input argument. If you don't supply it by calling the function from command line or another function then it won't exist.

1 Comment

aditi15
aditi15 on 13 Mar 2017
Edited: aditi15 on 13 Mar 2017
Hey I am calling it in main as pwlcm(2); Okay its running successfully thanx

Sign in to comment.

More Answers (0)

Categories

Find more on Argument Definitions in Help Center and File Exchange

Asked:

on 13 Mar 2017

Edited:

on 13 Mar 2017

Community Treasure Hunt

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

Start Hunting!