필터 지우기
필터 지우기

Making Matrix Dimensions Equal

조회 수: 3 (최근 30일)
Suki Sule
Suki Sule 2016년 3월 9일
답변: Ilham Hardy 2016년 3월 9일
I have a matrix 5130 x 2 (5130 rows and 2 columns). A second matrix is 2150 x 2. How can I make this equal to 5130 x 2 without losing or adding information, for instance by adding or subtracting zeros?

채택된 답변

Ilham Hardy
Ilham Hardy 2016년 3월 9일
A = ones(5130,2);
B = ones(2150,2);
BA = vertcat(B,zeros(abs(length(A)-length(B)),2));
How come that this does not count as adding information? :)

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Multidimensional Arrays에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by