How to plot x y data with y value repeating with a given interval while x continously increasing?
Ältere Kommentare anzeigen
I have actual x and y data for a length of 8193, i.e Z=[(X1,Y1) (X2,Y2)....(X8193,Y8193)] . I want to plot (xn,yn) for n size of data pairs with repeating the y value after each 8193 interval while the x continuously increment with one for each data. thanks
Antworten (1)
Srijith Vijay
am 25 Jan. 2018
j = 1;
for i = 1:n
if(j==8194)
j = 1;
end
plot(x(i), y(j));
j = j+1;
end
2 Kommentare
seble mekonnen
am 25 Jan. 2018
Srijith Vijay
am 26 Jan. 2018
In your code snippet, the value of index i exceeds the size of y and y(i) = y(5)-y(i-5) tries to access the value of y outside its bounds.
You can make use of the "repmat" function to create the vector y based on the number of samples to plot.
Kategorien
Mehr zu Line Plots finden Sie in Hilfe-Center und File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!