Why am I getting undefined variable error?

 采纳的回答

Adam
Adam 2017-3-13
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 个评论

Hey I am calling it in main as pwlcm(2); Okay its running successfully thanx

请先登录,再进行评论。

更多回答(0 个)

类别

帮助中心File Exchange 中查找有关 Argument Definitions 的更多信息

Community Treasure Hunt

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

Start Hunting!

Translated by