Perform rssq on each row

조회 수: 10 (최근 30일)
Curious Mind
Curious Mind 2020년 4월 8일
댓글: Curious Mind 2020년 4월 8일
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일
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개)

카테고리

Help CenterFile Exchange에서 Optimization에 대해 자세히 알아보기

태그

제품


릴리스

R2019b

Community Treasure Hunt

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

Start Hunting!

Translated by