Plotting elements of an array
Show older comments
I have an array and I would like to plot the number 1 against the value of the first element, 2 against the value of the second element, and so on, up to the final element which is the 40,000th element.
How do I go about doing this?
Answers (1)
Star Strider
on 30 Jan 2015
My approach:
y = randi(10, 4E+4, 1); % Simulated Data
x = 1:length(y); % ‘x’ (Independent) Variable
figure(1) % Plot
plot(x, y)
grid
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!