can i change the x axis without changing the plot? So i have a array with 10000 numbers in it, i want to plot thoes 10000 numbers in time, like 0-10sec insted of 0-10000.
조회 수: 2 (최근 30일)
이전 댓글 표시
buf = ones(10000,1)*nan;
i = 1; x = rand(10000,1);
for i <= 10000 buf(i,1) = x i = i+1; end plot(buf)
댓글 수: 0
채택된 답변
Chris McComb
2015년 4월 14일
You just need to supply a vector of x values. Something like
x = linspace(0, 10, length(buf));
Then, just plot as
plot(x, buf);
댓글 수: 0
추가 답변 (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!