Multiplication of two arrays with different size

33 views (last 30 days)
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?

Answers (1)

Star Strider
Star Strider on 15 Jan 2015
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.

Categories

Find more on Multidimensional Arrays in Help Center and File Exchange

Community Treasure Hunt

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

Start Hunting!