필터 지우기
필터 지우기

Why the error......assignment has more non-singleton rhs dimensions than non-singleton subscripts?

조회 수: 1 (최근 30일)
I have written a code to calculate the end grade(sum) while dropping the lowest grade value between a specific number of columns in a matrix. My current code will be written below. I get the error assignment has more non-singleton rhs dimensions than non-singleton subscripts. Thanks in advance.
function updatedGrades = computeTotal(sectionGrades)
sectionGrades(:,end+1) = sum(sectionGrades(:,3:8),2)-min(sectionGrades(:,3:8),2)+sum(sectionGrades(:,9:10),2);

채택된 답변

Walter Roberson
Walter Roberson 2017년 11월 25일
Change
min(sectionGrades(:,3:8),2)
to
min(sectionGrades(:,3:8),[],2)

추가 답변 (0개)

카테고리

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

태그

Community Treasure Hunt

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

Start Hunting!

Translated by