Plotting elements of an array

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?

답변 (1개)

Star Strider
Star Strider 2015년 1월 30일

0 개 추천

My approach:
y = randi(10, 4E+4, 1); % Simulated Data
x = 1:length(y); % ‘x’ (Independent) Variable
figure(1) % Plot
plot(x, y)
grid

카테고리

도움말 센터File Exchange에서 2-D and 3-D Plots에 대해 자세히 알아보기

태그

질문:

Dst
2015년 1월 29일

답변:

2015년 1월 30일

Community Treasure Hunt

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

Start Hunting!

Translated by