I am not getting the title, x axis, y axis label in the graph eventhough In code i given title('Demonstration of Rolles theorem'); xlabel('x-axis') ylabel("y-axis")

조회 수: 3 (최근 30일)
  댓글 수: 1
Prachi Kulkarni
Prachi Kulkarni 2022년 1월 11일
Hi,
I implemented your code, in MATLAB R2021b, on a sample symbolic expression.
It shows the legend, title, xlabel, ylabel for the figure.
Here’s the example code.
syms x
f = x^2;
r=0;
a=-2;
b=2;
tval=subs(f,x,r);
xval=linspace(a,b,100);
yval=subs(f,x,xval);
plot(xval,yval);
[p,q]=size(xval);
for i=1:length(tval)
hold on;
plot(xval,tval(i)*ones(p,q),'r');
hold on;
plot(r(i),tval(i),'ok');
end
hold off;
legend('Function','Tangent');
title('Demonstration of Rolles Theorem');
xlabel('x-axis')
ylabel("y-axis")
And this is the output figure.
If you are still facing the issue, can you please share your full code and which release of MATLAB you are using?

댓글을 달려면 로그인하십시오.

답변 (0개)

카테고리

Help CenterFile Exchange에서 Labels and Annotations에 대해 자세히 알아보기

태그

Community Treasure Hunt

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

Start Hunting!

Translated by