Loop for plot vectors

1 次查看(过去 30 天)
abdullah al-dulaimi
回答: Jan 2022-12-6
I have this Data below, I want to plot column number 4 with 5 For each 10 raws, i try to use loop for this issue to plot all data automatically.
20 10 80 805 82.1420812600000
20 10 80 815 82.5962426700000
20 10 80 825 83.0389831800000
20 10 80 835 83.4699908200000
20 10 80 845 83.8896382500000
20 10 80 855 84.2982532800000
20 10 80 865 84.6960746400000
20 10 80 875 85.0833919500000
20 10 80 885 85.4605315700000
20 10 80 895 85.8267390600000
20 10 80 905 86.1843723100000
20 10 80 915 86.5321793200000
20 10 80 925 86.8715343500000
20 10 80 935 87.2021683100000
20 10 80 945 87.5244455200000
30 10 80 805 84.4953351700000
30 10 80 815 84.9111542400000
30 10 80 825 85.3157596600000
30 10 80 835 85.7094764100000
30 10 80 845 86.0926231200000
30 10 80 855 86.4629108300000
30 10 80 865 86.8250898300000
30 10 80 875 87.1773925300000
30 10 80 885 87.5201869600000
30 10 80 895 87.8536800000000
30 10 80 905 88.1782819700000
30 10 80 915 88.4925349600000
30 10 80 925 88.7979872900000
30 10 80 935 89.0957112400000
30 10 80 945 89.3860526900000
  4 个评论
Torsten
Torsten 2022-12-6
plot(A(1:10:end,4),A(1:10:end,5))
where A is your matrix.
abdullah al-dulaimi
brother i want to plot one curve that have line (plot) of first 10 rows and second 10 rows ..... end

请先登录,再进行评论。

采纳的回答

Jan
Jan 2022-12-6
A = [20 10 80 805 82.1420812600000
20 10 80 815 82.5962426700000
20 10 80 825 83.0389831800000
20 10 80 835 83.4699908200000
20 10 80 845 83.8896382500000
20 10 80 855 84.2982532800000
20 10 80 865 84.6960746400000
20 10 80 875 85.0833919500000
20 10 80 885 85.4605315700000
20 10 80 895 85.8267390600000
20 10 80 905 86.1843723100000
20 10 80 915 86.5321793200000
20 10 80 925 86.8715343500000
20 10 80 935 87.2021683100000
20 10 80 945 87.5244455200000
30 10 80 805 84.4953351700000
30 10 80 815 84.9111542400000
30 10 80 825 85.3157596600000
30 10 80 835 85.7094764100000
30 10 80 845 86.0926231200000
30 10 80 855 86.4629108300000
30 10 80 865 86.8250898300000
30 10 80 875 87.1773925300000
30 10 80 885 87.5201869600000
30 10 80 895 87.8536800000000
30 10 80 905 88.1782819700000
30 10 80 915 88.4925349600000
30 10 80 925 88.7979872900000
30 10 80 935 89.0957112400000
30 10 80 945 89.3860526900000];
axes('NextPlot', 'add');
for k = 1:10:size(A, 1)
plot(A(k:k+9, 4), A(k:k+9, 5));
end

更多回答(0 个)

类别

Help CenterFile Exchange 中查找有关 Annotations 的更多信息

Community Treasure Hunt

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

Start Hunting!

Translated by