New to Matlab and need help with simple calc

I have two matrices not in particular order for the context info. As per file attached - tab 'MatlabForum'
For given Restaurant name and Item Name i want to multiple 'Type' Ordered with dish for the given qtr.
For example
RestaurantThree Tacos 2500*50 in QuarterOne and so on up to QuarterFour
How do i do it?
For

10 Comments

Sorry no file seems to be attached.
Here it is , hope this works.
Sample input extracted from file:
Restaurant Item Category Type QuarterOne QuarterTwo QuarterThree QuarterFour
RestaurantOne PaneerMasala Indian dish 1000 1000 2000 3000
Your description suggests that you want to multiply something by something, but I have not been able to figure out what, or why you would want to order them. Is the data for Matrix1 a price, and the data for Matrix2 a volume (or the other way around perhaps) ? So you want to find the corresponding entries and multiply them together to get earnings ?
So if you can look into file, i have to matrices.
Both has 'Type'. First one has 'dish' , second matrix has 'ordered'.
I want to multiply 'dish' numbers of for each qtr with 'ordered' number for the same qtr of the same resturant and item. So you can see for ResturantThree Tacos for QuarterOne answer shd be = 2500*50. Hope this helps
My challenge here is that data in both matrix are in random order for the given resturant and item.
How do i make sure the the same Resturant and Item's 'dish' is multiplied with 'ordered'
I have uploaded file which has 'result matrix'. that can help to convey what i want to do.
Have you thought about just running the matrices through a sort routine to start with? A simple "bubble" sort would be quick for a short matrix, you would just have to check both the Restaurant and Item columns.
ismember() or strcmp()

Sign in to comment.

Answers (0)

Categories

Products

Asked:

on 31 Oct 2013

Commented:

on 6 Nov 2013

Community Treasure Hunt

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

Start Hunting!