Subtract every element of array from one another and find the sum

조회 수: 1 (최근 30일)
Shweta Saboo
Shweta Saboo 2019년 11월 1일
댓글: Walter Roberson 2019년 11월 2일
I want to subtract each element from one another and find the sum of each column for every element. Array is [47.07 49.39 56.87 69.04 72.80 72.68]
  댓글 수: 1
ME
ME 2019년 11월 1일
I’m not 100% sure I follow. Could you possibly post your expected result from this?

댓글을 달려면 로그인하십시오.

답변 (1개)

Walter Roberson
Walter Roberson 2019년 11월 1일
  댓글 수: 4
Shweta Saboo
Shweta Saboo 2019년 11월 1일
I want to extract the row from the following matrix having maximum area corresponding to 3rd and 4th column(i.e. 4th row)
349 256 53 53
311 405 72 72
309 330 86 86
531 389 191 191
Walter Roberson
Walter Roberson 2019년 11월 2일
[~, maxidx] = max(YourMatrix(:,3)*YourMatrix(:,4));
ExtractedRow = YourMatrix(maxidx,:);

댓글을 달려면 로그인하십시오.

카테고리

Help CenterFile Exchange에서 Creating and Concatenating Matrices에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by