How to skip data point by plotting in 2D-curves surf-curve?

조회 수: 4 (최근 30일)
Emerson De Souza
Emerson De Souza 2011년 10월 19일
I would like to know how to skip data points by plotting 2d-curves?
For example, let:
x = 0:pi/100:2*pi;
y = sin(x);
plot(x,y);
What should I write if I want to display only every n-ten data point?
Thank you in advance Emerson

채택된 답변

Fangjun Jiang
Fangjun Jiang 2011년 10월 19일
x = 0:pi/100:2*pi;
y = sin(x);
M=numel(x);
n=7;
index=1:n:M
plot(x(index),y(index));
  댓글 수: 2
Emerson De Souza
Emerson De Souza 2011년 10월 20일
Thank you Fangjun,
I used your suggestion and fixed my problem.
Do you know how to add the Minor Ticks from the command Line?
Currently, I'm editing the Major Ticks as follows:
set(gca)
set(gca,'XTick',0:1:7)
set(gca,'YTick',-1:0.5:1)
but I found no documentation for minor ticks.
I hope you are familiar with this subject
Thank you again for your help
Emerson
Fangjun Jiang
Fangjun Jiang 2011년 10월 20일
It is not available.
http://www.mathworks.com/support/solutions/en/data/1-15B707/index.html?solution=1-15B707

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

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Introduction to Installation and Licensing에 대해 자세히 알아보기

태그

제품

Community Treasure Hunt

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

Start Hunting!

Translated by