How to plot symbolic function with string specification?
1 Ansicht (letzte 30 Tage)
Ältere Kommentare anzeigen
Niklas Kurz
am 3 Feb. 2022
Beantwortet: Steven Lord
am 3 Feb. 2022
Briefly I want to execute
syms x
f = x
fplot(f,'b','LineWidth',2)
but a little fancier. I want the specification to be a string that I just can add. For instance:
syms x
f = x
str = ['b','LineWidth',2];
fplot(f,str)
Unfortunately this outputs an error
0 Kommentare
Akzeptierte Antwort
Steven Lord
am 3 Feb. 2022
Store your options as a cell array and turn it into a comma-separated list when you call fplot.
syms x
f = x;
options = {'b','LineWidth',2};
fplot(f, options{:})
0 Kommentare
Weitere Antworten (1)
KSSV
am 3 Feb. 2022
May be you can consider using like below.
syms x ;
f = x ;
h = fplot(f) ;
h.LineWidth = 2 ;
0 Kommentare
Siehe auch
Kategorien
Mehr zu Calculus 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!