Create the x axis to my need
12 views (last 30 days)
Show older comments
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)));
0 Comments
Accepted Answer
Arif Hoq
on 20 Mar 2022
try this:
y = transpose((0:1:49));
xaxis = transpose(1:0.5:length(y)/2+1/2);
plot(xaxis,y)
3 Comments
More Answers (0)
See Also
Categories
Find more on Line Plots in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!