Can you please help me to get the square root of the sum of squares of the second column in the text file ?

2 次查看(过去 30 天)
Hello everyone, Thank you for reading this query. I need some help to read the text file attached and replace the NaN with the 0 and also find the square root of the sum of squares for the second column and store the result to a certain variable. Can you help me with the code?
  4 个评论

请先登录,再进行评论。

采纳的回答

Matt J
Matt J 2022-9-28
编辑:Matt J 2022-9-28
Your attachment didn't make it, but assuming it's called yourFile.txt,
[~,col]=readvars('yourFile.txt');
result = norm(col(~isnan(col)));
  7 个评论

请先登录,再进行评论。

更多回答(0 个)

类别

Help CenterFile Exchange 中查找有关 Logical 的更多信息

产品


版本

R2022a

Community Treasure Hunt

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

Start Hunting!

Translated by