Eliminates a value less than 1 and replace with nan for all the row
Mostra commenti meno recenti
Good Day, thank you for reading me, i am using matlab R2019 and i have this problem.
I need to eliminate from the vector of wind Velocity values less than 1 and replace with nan in all the row, so the vector of wind direction is also NaN, and everything is ok, but in the final start to replace all with NaN
Can you please tell me, what i am doing wrong
i attach the code and the file.
Thank you very much for your valious time, i know the program is very simple but before it was working
opts = detectImportOptions('tempdat.xlsx','DataRange','A5','VariableNamesRange','A2');
TT = readtimetable('tempdat.xlsx',opts);
TT = retime(TT,'regular','fillwithmissing','TimeStep',minutes(10));Matrix = TT{:,:}; %convert values to matrix
V = Matrix(:,2:3);
VelVien = V(:,1);
ind = (abs(VelVien)<=1);
VelVien(ind)=NaN;
V(ind,:)=NaN;
writetimetable(TT, 'somefile.xlsx');
Best
4 Commenti
Codeshadow
il 1 Giu 2020
Modificato: Codeshadow
il 1 Giu 2020
I belive there is a typo in naming your variable.
Try changing VelVient to VelVien in Line 7 and see if that fixes your problem :)
Ana Soph
il 1 Giu 2020
Codeshadow
il 1 Giu 2020
Could you please show me the error message you get? Your code seems to work in r2020a.
Ana Soph
il 1 Giu 2020
Risposta accettata
Più risposte (0)
Categorie
Scopri di più su Axis Labels in Centro assistenza e File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!

