How to assign sequence values to an specific column of a table?
조회 수: 12 (최근 30일)
이전 댓글 표시
I'm trying to assign values from 1 to 720 to a table I already created but I keep getting error.
size = [720 4];
Type = ["double","double","double","double"];
Names = ["Hours","PrEV","SoCEV","Gen"];
master = table('Size',size,'VariableTypes',Type,'VariableNames',Names);
With this I have the table but how can I assign a sequence of numbers from 1 to 720 to the column Hours?
댓글 수: 1
답변 (1개)
David Hill
2022년 11월 28일
size = [720 4];
Type = ["double","double","double","double"];
Names = ["Hours","PrEV","SoCEV","Gen"];
master = table('Size',size,'VariableTypes',Type,'VariableNames',Names);
master.Hours=(1:720)'
댓글 수: 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!