How to plot signal continuously?

조회 수: 1 (최근 30일)
VK.
VK. 2018년 6월 5일
편집: Birdman 2018년 6월 5일
Hi, I have vector which length is 120798 and I want to plot it on graph continuously in time. For example, I want to have 15 seconds of signal on the plot all the time. Is there any way to do this?

답변 (1개)

Birdman
Birdman 2018년 6월 5일
편집: Birdman 2018년 6월 5일
Consider the following approach:
A=randi([1 5],1,120798); %this is demo data, you will use your own data instead of this
Tend=15; %you want to plot for 15 seconds
t=0:Tend/numel(A):Tend-(Tend/numel(A));
plot(t,A)
Hope this helps.
  댓글 수: 2
VK.
VK. 2018년 6월 5일
Thanks for your answer. Can you tell me please what is 'val' in your code?
Birdman
Birdman 2018년 6월 5일
Ups sorry, that should be Tend as well. My mistake. I edited it.

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

카테고리

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

Community Treasure Hunt

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

Start Hunting!

Translated by