필터 지우기
필터 지우기

How to make a matrix from several column vector

조회 수: 2 (최근 30일)
Luis
Luis 2022년 10월 9일
답변: Chunru 2022년 10월 9일
I have 3 colum vectors the first one with 1 value the second one with 10 values and the 3th one with 100 values. and i need to marge them into a matrix
EXP
A=
X1
B=
Y1
Y2
Y3
.
to 10
C=
Z1
Z2
Z3
Z4
to 100
MATRIX
X1 Y1 Z1
Y2 Z2
Y3 Z3
To 10 To 100
Thansk for the help
Luis

답변 (1개)

Chunru
Chunru 2022년 10월 9일
a = rand(1,1);
b = rand(10,1);
c = rand(100,1);
% you are not able to combine them into a matrix as you sepcified since they have different
% size.
% you can put them into a cell array instead:
d ={a, b, c}
d = 1×3 cell array
{[0.1748]} {10×1 double} {100×1 double}
d{1}
ans = 0.1748
d{2}
ans = 10×1
0.3426 0.2732 0.7685 0.9592 0.6899 0.2761 0.2817 0.6932 0.9073 0.6088

카테고리

Help CenterFile Exchange에서 Time Series에 대해 자세히 알아보기

제품

Community Treasure Hunt

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

Start Hunting!

Translated by