Effacer les filtres
Effacer les filtres

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

1 vue (au cours des 30 derniers jours)
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);

Réponse acceptée

Walter Roberson
Walter Roberson le 25 Nov 2017
Change
min(sectionGrades(:,3:8),2)
to
min(sectionGrades(:,3:8),[],2)

Plus de réponses (0)

Catégories

En savoir plus sur Logical dans Help Center et File Exchange

Tags

Community Treasure Hunt

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

Start Hunting!

Translated by