Index exceeds matrix dimensions
1 次查看(过去 30 天)
显示 更早的评论
char_date_start= char(date_start);
char_date_end = char(date_end);
yearRange = str2num(char_date_start(1:4))+1:1:str2num(char_date_end(1:4));
dateCheck = table(yearRange',zeros(length(yearRange),1),'VariableNames',{'WaterYear','DayCount'});
1 个评论
回答(1 个)
Ridwan Alam
2019-12-19
I tried this, it worked fine. No error:
date_start = "2015-01-01";
date_end = "2019-10-01";
char_date_start= char(date_start);
char_date_end = char(date_end);
yearRange = str2num(char_date_start(1:4))+1:1:str2num(char_date_end(1:4));
dateCheck = table(yearRange',zeros(length(yearRange),1),'VariableNames',{'WaterYear','DayCount'});
What's your date_start and date_end?
0 个评论
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Matrix Indexing 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!