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.

 채택된 답변

Star Strider
Star Strider 2021년 2월 12일

0 개 추천

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.
As always, my pleasure!

댓글을 달려면 로그인하십시오.

추가 답변 (0개)

카테고리

도움말 센터 및 File Exchange에서 Graphics Objects에 대해 자세히 알아보기

제품

릴리스

R2020b

태그

질문:

2021년 2월 12일

댓글:

2021년 2월 12일

Community Treasure Hunt

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

Start Hunting!

Translated by