How do I plot a symbolic function of one variable for a specific set of argument values?

2 views (last 30 days)
Valeri Aronov
Valeri Aronov on 30 May 2021
Edited: Valeri Aronov on 3 Jun 2021
Say, I have a symbolic function y(x). There is no support for plotting it when x=logspace(1, 5, 101) in fplot(). How do I do it nicely?

Answers (1)

Walter Roberson
Walter Roberson on 30 May 2021
syms y(x)
y(x) = cos(x) * exp(-x/10)
y(x) = 
fplot(y, [10 100])
title('fplot')
X = logspace(1, 2, 101);
Y = double(subs(y, x, X));
plot(X, Y)
title('subs')
  3 Comments

Sign in to comment.

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by