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

Ridwan Alam
Ridwan Alam 2019년 12월 20일
Hi Megan, does the response below work? If yes, please accept the answer.

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

답변 (1개)

Ridwan Alam
Ridwan Alam 2019년 12월 19일

0 개 추천

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?

카테고리

도움말 센터File Exchange에서 Matrix Indexing에 대해 자세히 알아보기

질문:

2019년 12월 18일

댓글:

2019년 12월 20일

Community Treasure Hunt

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

Start Hunting!

Translated by