Perform rssq on each row

1 visualización (últimos 30 días)
Curious Mind
Curious Mind el 8 de Abr. de 2020
Comentada: Curious Mind el 8 de Abr. de 2020
Hi, I have an 100:5000 data matrix called X and I want to perform root-sum-of-squares level on each row of X and output the result in Y. How do I go about it? Each row is unique and hence I want to know the rssq for each row. Thanks so much.

Respuesta aceptada

Rik
Rik el 8 de Abr. de 2020
All relevant functions support array operations and sum allows you to specify the dimension to operate along.
X=rand(100,5000);
Y=sqrt(sum(X.^2,2));

Más respuestas (0)

Categorías

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

Etiquetas

Productos


Versión

R2019b

Community Treasure Hunt

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

Start Hunting!

Translated by