Why am I getting undefined variable error?

 Réponse acceptée

Adam
Adam le 13 Mar 2017

0 votes

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 commentaire

aditi15
aditi15 le 13 Mar 2017
Modifié(e) : aditi15 le 13 Mar 2017
Hey I am calling it in main as pwlcm(2); Okay its running successfully thanx

Connectez-vous pour commenter.

Plus de réponses (0)

Catégories

En savoir plus sur Argument Definitions dans Centre d'aide et File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by