How make the number of columns of two matrices equal?

조회 수: 3 (최근 30일)
Ruaa Anooz
Ruaa Anooz 2022년 9월 27일
답변: Steven Lord 2022년 9월 27일
how I make the number of columns for two matrices equal in the code IF I have code generate data with matrix 20X 5000 and another matrix with size 61X6100 when I want to concatenate a row array with a column array? if any one help me please.

답변 (1개)

Steven Lord
Steven Lord 2022년 9월 27일
There are a number of possibilities. Off the top of my head:
  • You could discard 1100 columns of the second matrix (the first 1100, the last 1100, half from the left and half from the right, etc.)
  • You could pad the first matrix with 1100 more columns (full of all 0 values, full of NaN values, duplicates of 1100 columns from that matrix, etc.)
  • You could interpolate one of the matrices so that they span the same "range" as the original but the spaces between columns is different (take hourly data and interpolate it to data with spacing of a minute, for example.)
What is the (or a) correct solution for your data depends on what it represents and how the two matrices relate to one another.

카테고리

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

태그

Community Treasure Hunt

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

Start Hunting!

Translated by