Not enough input arguments
1 Ansicht (letzte 30 Tage)
Ältere Kommentare anzeigen
Ayberk Bulut
am 13 Jan. 2021
Beantwortet: James Tursa
am 14 Jan. 2021
clc;
clear;
y=0;
x = input('What is the value of x ? ');
if(-1 <= x && x<= 1)
prompt = 'What is the value of N ? ';
N = input(prompt);
disp('Statement requires function1')
disp(quiz6_func1(x))
else
disp('Statement requires function2')
disp(quiz6_func2(x))
end
This is the main code.
If i give the value of x for example 0.2 the following output is:
And the function that main program is calling:
I couldn't find the problem that why the function i am calling can't execute it byself.
Because if run the quiz6_func1(0.2, 20) in the command window it gives the output.
Why it gives enough input arguments? Because on my workspace where i can see the values, i can see that N got the value i gave.
0 Kommentare
Akzeptierte Antwort
James Tursa
am 14 Jan. 2021
You need to call the function with the N input you just got from the user. E.g.,
disp(quiz6_func1(x,N))
0 Kommentare
Weitere Antworten (0)
Siehe auch
Kategorien
Mehr zu Loops and Conditional Statements finden Sie in Help Center und File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!