Plotting elements of an array

7 ビュー (過去 30 日間)
Dst
Dst 2015 年 1 月 29 日
回答済み: Star Strider 2015 年 1 月 30 日
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 日
My approach:
y = randi(10, 4E+4, 1); % Simulated Data
x = 1:length(y); % ‘x’ (Independent) Variable
figure(1) % Plot
plot(x, y)
grid

カテゴリ

Help Center および File Exchange2-D and 3-D Plots についてさらに検索

タグ

Community Treasure Hunt

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

Start Hunting!

Translated by