How to plot symbolic function with string specification?
조회 수: 1 (최근 30일)
이전 댓글 표시
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
채택된 답변
Steven Lord
2022년 2월 3일
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
추가 답변 (1개)
KSSV
2022년 2월 3일
May be you can consider using like below.
syms x ;
f = x ;
h = fplot(f) ;
h.LineWidth = 2 ;
댓글 수: 0
참고 항목
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!