필터 지우기
필터 지우기

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 CenterFile Exchange에서 2-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