Plotting with full range in the axes
Show older comments
Hi!
I would really like to know how I can make my x-axes with full range, because it stops at 3.
Thank you!
%% Practice 3.6
% Write a script that plots exp(x) and log(x)
% for values of x ranging from 0 to 3.5
clf
x=[0:3.5];
y=exp(x);
plot(x,y,'ro')
hold on
y=log(x);
plot(x,y,'b+')
legend('exp(x)','log(x)')
xlabel('x')
ylabel('exp(x) or log(x)')
title('exp and log on one graph')
Accepted Answer
More Answers (1)
Prakhar Mishra
on 12 Jun 2021
clf
x=[0:3.5];
y=exp(x);
plot(x,y,'ro')
hold on
y=log(x);
plot(x,y,'b+')
legend('exp(x)','log(x)')
xlabel('x')
ylabel('exp(x) or log(x)')
title('exp and log on one graph')
1 Comment
Walter Roberson
on 12 Jun 2021
That appears to be the same code posted originally, except without the original comments. It has the same problem that I described in 2018.
Categories
Find more on MATLAB in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!