Borrar filtros
Borrar filtros

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

2 visualizaciones (últimos 30 días)
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 comentarios

Iniciar sesión para comentar.

Respuesta aceptada

Matt J
Matt J el 28 de Sept. de 2022
Editada: Matt J el 28 de Sept. de 2022
Your attachment didn't make it, but assuming it's called yourFile.txt,
[~,col]=readvars('yourFile.txt');
result = norm(col(~isnan(col)));
  7 comentarios
Matt J
Matt J el 29 de Sept. de 2022
Editada: Matt J el 29 de Sept. de 2022
@Phenicia assuming you are also @Adeline War,
You're quite welcome, but please Accept-click the answer to certify that.

Iniciar sesión para comentar.

Más respuestas (0)

Categorías

Más información sobre Logical en Help Center y File Exchange.

Productos


Versión

R2022a

Community Treasure Hunt

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

Start Hunting!

Translated by