필터 지우기
필터 지우기

axis labels not working

조회 수: 80 (최근 30일)
Allen Antony
Allen Antony 2020년 9월 19일
댓글: Voss 2024년 4월 3일
Hey i was doing some work for uni and I was doing some simple plotting. for some reason the axis labels ang legends are not showing on the figure. What i wrote on my scipt is attatched below. I have also attatched what it shows on my figure. This is the error meesage shown when I played my program. Sorry for the mess I'm not sure how to organise things on the question page.
>> PBTask2p5
Index exceeds the number of array elements
(7).
Error in PBTask2p5 (line 5)
xlabel('time)');
t = 0:0.1:2*pi;
f=sin(t);
g=cos(t);
plot(t,f,t,g,'r--');
xlabel('time)');
ylabel('Some y axis');
title('Graph of sin and cos of x');
legend({'sin,cos'});

채택된 답변

Walter Roberson
Walter Roberson 2020년 9월 19일
At some point you tried to set the xlabel by using
xlabel = 'time'
instead of
xlabel('time')
When you did that, xlabel became a variable instead of a function.
  댓글 수: 3
archie
archie 2024년 4월 3일
Hi, I have done this, how do I fix it such that the lables function correctly again
Voss
Voss 2024년 4월 3일

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

추가 답변 (0개)

카테고리

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

태그

Community Treasure Hunt

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

Start Hunting!

Translated by