Create the x axis to my need

9 次查看(过去 30 天)
Hello and thanks in advanced!
I´m having problems ploting some data I receive from an OBR. The problem is that the data I receive comes separated, on the one hand I have the y axis data (50x1 double) and on the other hand I have the x axis data (4096x1 double). The problem comes when I try to plot because if I try to decimate the graph I get is not perfect do to 4096 and 50 not been multiples.
So as the data received in the x axis is not important i have tried to create my own x axis and here is where my doubt is. I need this x axis to have the same length as the y axis so I can plot them together but the x axis must have every digit of the array separated 0.5 cm.
y = transpose((0:1:49));
xaxis = transpose((0:0.5:length(y)));

采纳的回答

Arif Hoq
Arif Hoq 2022-3-20
try this:
y = transpose((0:1:49));
xaxis = transpose(1:0.5:length(y)/2+1/2);
plot(xaxis,y)

更多回答(0 个)

类别

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