Undefined function or variable??
Infos
Cette question est clôturée. Rouvrir pour modifier ou répondre.
Afficher commentaires plus anciens
When calling a function in a script, I keep getting the same "Undefined function or variable 'input3'". The function is described below :
function results = f(input1,input2, input3, input4)
....
...
Later on in function, I use input3 and get the error message "Undefined function or variable 'input3'". I checked the function, script and everything and there are no typos. I don't understand how matlab is not recognizing the variable when it is clearly an input into the function. Help would be appreciated.
Réponses (1)
madhan ravi
le 22 Juin 2020
input1 =1;
input2 = 2;
input3 = 3;
input4 = 4;
results = f(input1,input2, input3, input4) % this is how you call a function, assuming that the function is saved in a file called “f.m” if you’re using versions before 2016b
8 commentaires
John Madsen
le 22 Juin 2020
madhan ravi
le 22 Juin 2020
Show how your calling the function and the value of input3 using a screenshot.
madhan ravi
le 22 Juin 2020
How’s this even related to the original question you asked??
John Madsen
le 22 Juin 2020
madhan ravi
le 22 Juin 2020
Sure, attach your file.
John Madsen
le 22 Juin 2020
Walter Roberson
le 23 Juin 2020
Does madsen_plot_ROC have an evalin('caller') or assignin('caller') in it?
If not then copy the madsen_plotROC portion of the call from two lines above, pasting it over the call on that line. We know the line two above worked because we had to get through it to get to the (3,2,4) plot. Doing the copy/paste would remove the possibility of an invisible typing mistake that is not obvious due to the font.
John Madsen
le 23 Juin 2020
Cette question est clôturée.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!