フィルターのクリア

How can I plot and label 4 lines from 1 vector?

4 ビュー (過去 30 日間)
schilakwad
schilakwad 2020 年 11 月 3 日
回答済み: KSSV 2020 年 11 月 3 日
I have a function that creates 1 long vector from a row in a table (124 columns) and then plots that vector. I'd like to divide that vector into 4 parts and plot each part as a line on the same graph with its own lable e.g. Vector - Part 1, Vector - Part 2 etc. The X axis is the same for all the parts.
  1 件のコメント
Rik
Rik 2020 年 11 月 3 日
What have you tried? Can you post example data?

サインインしてコメントする。

採用された回答

KSSV
KSSV 2020 年 11 月 3 日
Read about reshape, plot and legend.
A = rand(1,124) ;
B = reshape(A,[],4) ; % reshape into 4 columns
plot(B)
legend("Part1","part2","part3","part4")

その他の回答 (0 件)

カテゴリ

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

タグ

製品


リリース

R2019b

Community Treasure Hunt

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

Start Hunting!

Translated by