Multiplication of two arrays with different size

11 vues (au cours des 30 derniers jours)
Cladio Andrea
Cladio Andrea le 15 Jan 2015
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?

Réponses (1)

Star Strider
Star Strider le 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.

Catégories

En savoir plus sur Multidimensional Arrays dans Help Center et File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by