Multiplication of two arrays with different size

조회 수: 11 (최근 30일)
Cladio Andrea
Cladio Andrea 2015년 1월 15일
답변: Star Strider 2015년 1월 15일
I have two arrays one is 200x2 always remains same after simulation, and then i have another array that changes after simulation, lets say 190x4, but always less than 200 rows.. Now what i want to do is at that point. I have just ones and zeros for the fixed length array and there are some huge numbers inside the second array, after simulation i have to find a way for multiplication just for the first rows of each lia(:,1).*(data(:,1)) but the size doesn't match. Any ideas?

답변 (1개)

Star Strider
Star Strider 2015년 1월 15일
I would consider interpolating the shorter array using the interp1 function to make it have a length of 200. You would not have to extrapolate, and you would likely not lose much accuracy if your data in the smaller array were relatively smooth. You could then do your multiplication.

카테고리

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