Eliminates a value less than 1 and replace with nan for all the row

2 ビュー (過去 30 日間)
Ana Soph
Ana Soph 2020 年 6 月 1 日
コメント済み: Star Strider 2020 年 6 月 1 日
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 件のコメント
Codeshadow
Codeshadow 2020 年 6 月 1 日
Could you please show me the error message you get? Your code seems to work in r2020a.
Ana Soph
Ana Soph 2020 年 6 月 1 日
i don't have any error, the thing is in is suppose to replace all the values less or equal to 0 with nan, for the wind velocity, but in the end this is not occur, because in this line i have this:
but the program do this:
(the code is not supposed to remove those values)

サインインしてコメントする。

採用された回答

Star Strider
Star Strider 2020 年 6 月 1 日
What you want the result to be is not obvious.
Try this:
TT(ind,:)={NaN};
.
  2 件のコメント
Ana Soph
Ana Soph 2020 年 6 月 1 日
編集済み: Ana Soph 2020 年 6 月 1 日
thank you, i am your fan
Star Strider
Star Strider 2020 年 6 月 1 日
As always, my pleasure!
Thank you!

サインインしてコメントする。

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeCharacters and Strings についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by