How to do a Loop statement from cell to double?
이전 댓글 표시
Hi there
I have a file with wind information (direction and speed), the wind direction has this format (E, N, NE,...) I would like to do a wind rose from 1989 to 2019, so I have a file.xls with multiple sheets (from 1989 to 2019). I'm trying to convert the wind direction from (E, N, NE to 90, 0 , 45). But I do not know how to do it, any help? I post the file (1989.xlsx) and what I've been doing.
%% I created a artificial data to organized wind speed and direction
t1 = datetime(1989,01,01,00,00,00);
t2 = datetime(2019,12,31,23,00,00);
t = (t1:hours(1):t2)';
% my idea is to convert ('E', 'N'... to 90, 0) to the 30 years.
for i = length(1989.VarName1(10:40))
if 1989.Dir{10:40},'E' == 1;
1989.Dir(10:40)= 90;
end
end
채택된 답변
추가 답변 (1개)
카테고리
도움말 센터 및 File Exchange에서 Spreadsheets에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!