fplot too many input arguments
7 Ansichten (letzte 30 Tage)
Ältere Kommentare anzeigen
Hi, Stuggling to see where i am going wrong,
Run the code and tells me :
Warning: Error updating FunctionLine.
The following error was reported evaluating the function in
FunctionLine update: Too many input arguments.
Warning: Error updating FunctionLine.
The following error was reported evaluating the function in
FunctionLine update: Too many input arguments.
function plotFun()
%X1 = abs(sin(x)
%X2 = abs(sin(x/4)
hold on
fplot(@(x)abs(log(sin(x)),[-4*pi, 4*pi],'k:'));
fplot(@(x)abs(log(sin(x/4)),[-4*pi, 4*pi],'g-'));
hold off
end
its only beginner stuff but am stuck.
Thanks for the advice
Jon
0 Kommentare
Antworten (1)
Piyush Lakhani
am 12 Mär. 2020
Hi Jonathan,
I am not getting why you are running this function file. But, still if you required to run this you missed the brackets.
Corrected Code,
function plotFun()
%X1 = abs(sin(x)
%X2 = abs(sin(x/4)
hold on
fplot(@(x)abs(log(sin(x))),[-4*pi, 4*pi],'k:'));
fplot(@(x)abs(log(sin(x/4))),[-4*pi, 4*pi],'g-'));
hold off
end
If you are just intrested in plot then you may use following code that will give direct output.
hold on
fplot(@(x)abs(log(sin(x))),[-4*pi, 4*pi])
fplot(@(x)abs(log(sin(x/4))),[-4*pi, 4*pi])
hold off
Siehe auch
Kategorien
Mehr zu String Parsing 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!