How can I get percentage data from time series object?
조회 수: 1 (최근 30일)
이전 댓글 표시
How can I get data(x, y) of every 10%(0%, 10%, 20%, 30% ...100%) plots from time series object?
100% is max value of y axis data.
________________________________
x = sin(x);
y = linspace(0,1*pi,1000);
data1 = timeseries(x,y)
data_max = max(data1);
data_90per = data_max*0.9;
________________________________
I can't get x and y axis data of data_max and data_90per.
I wanna plot every 10% from time series object.
댓글 수: 0
답변 (1개)
KSSV
2018년 12월 26일
N = 1000 ;
x = linspace(0,2*pi,N) ;
y = sin(x) ;
p = 10:10:100 ;
for i = 1:length(p)
id = round(N*p(i)/100) ;
plot(x(1:id),y(1:id))
title(sprintf('percentage = %s',num2str(p(i))))
drawnow
end
댓글 수: 0
참고 항목
카테고리
Help Center 및 File Exchange에서 Line Plots에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!