how to create table Date/Value
조회 수: 1 (최근 30일)
이전 댓글 표시
i have this data (pic1) and i want similar pic2
Do I have to create the table by entering the values manually or is there a function to do this?
댓글 수: 1
Dyuman Joshi
2024년 1월 7일
Unless you provide specific and necessary details, in written form, explaining what the expected output is, I will be closing the question.
채택된 답변
Star Strider
2024년 1월 7일
Try this —
LD = load('matlab_data.mat')
T1 = table(year(LD.dat),month(LD.dat,'shortname'),LD.prof)
ResultSum = unstack(T1, 'Var3', 'Var2');
ResultSum.Properties.VariableNames{1} = 'Year'
The unstack function sums the data by default for each month. Other options are available by defining the appropriate function.
Example —
ResultMean = unstack(T1, 'Var3', 'Var2', 'AggregationFunction',@mean);
ResultMean.Properties.VariableNames{1} = 'Year'
.
댓글 수: 6
추가 답변 (0개)
참고 항목
카테고리
Help Center 및 File Exchange에서 Tables에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!