필터 지우기
필터 지우기

Plotting 150 datapoints on a 360datapoint scale.

조회 수: 1 (최근 30일)
Ferd
Ferd 2012년 3월 14일
Hey
How do you plot an extracted list having 150 datapoints against a 360 datapoints x-scale? If you would do it in Excel, one would have to insert zeros in those empty cells. In matlab, would using vectors work? If not, what would be the best and easiest answer?
Thanks
Ferd
  댓글 수: 5
Thomas
Thomas 2012년 3월 14일
Seems like you need to interpolate the datapoints as mentioned by Wayne below..
Ferd
Ferd 2012년 3월 14일
Yea, I'm trying all the different methods. (lol...)
Appreciate the advice and answers though.
Thanks

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

답변 (1개)

Wayne King
Wayne King 2012년 3월 14일
You can do the same thing as in Excel, you can upsample the vector by two and plot that.
Or you can interpolate to get an estimate of what the data vector is on a finer grid.
If you have the Signal Processing Toolbox, there is function upsample()
t = 1:300;
x = randn(150,1);
y = upsample(x,2,0);
stem(t,y);
To interpolate, you can use interp1().
t = 1:1/2:150;
x = randn(150,1);
t1 = 1:150;
y = interp1(t1,x,t);
plot(t,y);
There are a number of supported interpolation methods. You should choose which is most appropriate for you use case.
  댓글 수: 2
Ferd
Ferd 2012년 3월 14일
Hey Wayne,
I believe both answers would modify the final output to get it in the required box of 360points. However, I have those final points. Next, i would like to plot that 150 (x,y)points on a 360x360 global plot. Both the extracted list and the global plot have same axis units. i am thinking just a vector subtraction w.r.t origin might be ok to get both matrices in the same order.
Ferd
Ferd 2012년 3월 19일
Hey
No positive results yet.
I have two channels, Timings and fuel-in. The Timing matrix ranges from -12 to +10 (dbtdc) and my fuelling is in mg/stroke. Both the matrices are 160x1. Now, I have created a new CAD scale from -180 to +180(degrees) having an interval of 1degree(360x1)Matrix. I intend to plot the Timing channel on my newly created CAD scale so as to get data for only the fuelling event to be represented on the -180 to 180 cycle.
Thanks

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

카테고리

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

태그

Community Treasure Hunt

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

Start Hunting!

Translated by