using splitapply on a table to split a column with repeating rows

Hello, I'm using splitapply but cannot seem to solve the following where I have an initial table as follows but want the final table. Fin_year is categorical, Type is categorical, but Quantity and the resulting City_quantity and Rural_quantity are numeric. Notice the repeating year row values in the initial table.

 采纳的回答

See if the unstack function will do what you want.

4 个评论

I get this error message: Variable index exceeds table dimensions.
You will need to figure out what the problem is.
From the description in the documentation, it would appear to do what you want.
yes thanks, was missing the quation marks, it works now.

请先登录,再进行评论。

更多回答(0 个)

类别

在 帮助中心 和 File Exchange 中查找有关 Graphics Objects 的更多信息

产品

版本

R2020b

标签

Community Treasure Hunt

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

Start Hunting!

Translated by