How to match cell values across variables
2 次查看(过去 30 天)
显示 更早的评论
I've got a table where each row is a separate result, and 2 of the variables (Qstay, indvparkingtype) in there are doubles. The 2 variables correspondingly have the same size, but differs from result to result.
Across all the results, I want to sum up the values in one variable, matched to a value in the other variable.
The variable to be matched to (indvparkingtype) has about 10 different values, let's say [1,2,3...], and I want to sum for each value of indvparkingtype, the Qstay.
So for all instances where scenarioID=1, I would want to find the total Qstay for indvparkingtype=1, =2, =3 etc.
E.g. for indvparkingtype=6, I would want to add 0.2859+0+0.4516+0+0+6.1387+0+2.3656+0.7961+... etc
And to summarise so to have the sums for all values of indvparking type
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/312887/image.jpeg)
0 个评论
回答(0 个)
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Graphics Object Programming 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!