Can you please help me to get the square root of the sum of squares of the second column in the text file ?
2 vues (au cours des 30 derniers jours)
Afficher commentaires plus anciens
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 commentaires
Réponse acceptée
Matt J
le 28 Sep 2022
Modifié(e) : Matt J
le 28 Sep 2022
Your attachment didn't make it, but assuming it's called yourFile.txt,
[~,col]=readvars('yourFile.txt');
result = norm(col(~isnan(col)));
Plus de réponses (0)
Voir également
Catégories
En savoir plus sur Logical dans Help Center et File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!