Uneven data multiplication in Matlab
Show older comments
I have following
Data.numberOfDishes
Data.numOfLocations
As follows
numberOfDishes numberOfLocations
3 [1, 2, 4]
4 [9, 8, 5]
6 [11, 1, 9]
7 [2, 3, 4]
9 [7, 7, 7]
I want to have resulting column 'total' by doing numberOfDishes/each element of numberOfLocations
For example, so that 'total' for first row would be [3/1, 3/2, 3/4]
i know '.' would not work. mrdivide does not seem an option. Can i do this without having to create numberOfDishes of the same size as numOfLocations
Accepted Answer
More Answers (1)
Andrei Bobrov
on 18 Jun 2014
out = bsxfun(@rdivide,NumberOfDishes,NumberOfLocations);
Categories
Find more on Loops and Conditional Statements 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!