Plotting inside a function
2 Ansichten (letzte 30 Tage)
Ältere Kommentare anzeigen
Seyifunmi Ayeni
am 1 Dez. 2018
Kommentiert: Walter Roberson
am 1 Dez. 2018
unfortunately I can't post my code as it is over 300 lines long but it is more a plotting issue. My function works but when I do add fplot in my code like this:
function [Q] = code(L)
%function body
fplot(code(L), [1 5])
end
and when I ran my function I did code(1) assuming after it finished solving for 1 it will plot the graph but it has been only solving for 1 repeatedly.
Any advice.
0 Kommentare
Akzeptierte Antwort
Image Analyst
am 1 Dez. 2018
That's because the (badly-named) function "code()" calls itself recursively!
That's why code() executes repeatedly.
4 Kommentare
Weitere Antworten (0)
Siehe auch
Kategorien
Mehr zu 2-D and 3-D Plots 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!