Why am I getting undefined variable error?

1 件のコメント

aditi15
aditi15 2017 年 3 月 13 日
Line 3 if 0<= x <p has this error

サインインしてコメントする。

 採用された回答

Adam
Adam 2017 年 3 月 13 日

0 投票

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 件のコメント

aditi15
aditi15 2017 年 3 月 13 日
編集済み: aditi15 2017 年 3 月 13 日
Hey I am calling it in main as pwlcm(2); Okay its running successfully thanx

サインインしてコメントする。

その他の回答 (0 件)

カテゴリ

ヘルプ センター および File ExchangeArgument Definitions についてさらに検索

質問済み:

2017 年 3 月 13 日

編集済み:

2017 年 3 月 13 日

Community Treasure Hunt

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

Start Hunting!

Translated by