How to do a Loop statement from cell to double?
Afficher commentaires plus anciens
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
Réponse acceptée
Plus de réponses (1)
Fabian Moreno
le 26 Jan 2021
0 votes
Catégories
En savoir plus sur Spreadsheets dans Centre d'aide et File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!