Multiplication of two arrays with different size
12 次查看(过去 30 天)
显示 更早的评论
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?
0 个评论
回答(1 个)
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.
0 个评论
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Multidimensional Arrays 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!