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.

 採用された回答

Rik
Rik 2020 年 4 月 8 日

0 投票

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));

1 件のコメント

Curious Mind
Curious Mind 2020 年 4 月 8 日
Awesome! Thank you!

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

その他の回答 (0 件)

カテゴリ

製品

リリース

R2019b

タグ

質問済み:

2020 年 4 月 8 日

コメント済み:

2020 年 4 月 8 日

Community Treasure Hunt

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

Start Hunting!

Translated by