Filter löschen
Filter löschen

I have a .xls file that I have imported and I am needing to remove the min number from each row. going down by each row.

1 Ansicht (letzte 30 Tage)
grades = xlsread('gradedata.xls');
B = grades.'
B = 8×8
10 10 10 9 8 9 4 10 9 9 4 8 4 8 8 10 8 10 3 7 7 5 6 10 9 10 5 6 5 9 7 10 4 8 7 4 6 7 5 10 9 7 9 7 7 6 9 10 2 6 5 9 9 4 10 9 8 8 6 8 10 10 8 10
B(sub2ind(size(B),1:size(B,2))) = [];
B = reshape(B,[],size(grades,1)).'
B = 8×7
10 9 10 10 8 7 6 8 10 4 3 5 7 9 5 6 9 8 7 6 4 7 9 8 8 4 7 5 6 7 9 10 9 8 5 9 7 6 4 10 4 8 6 7 5 9 10 8 10 10 10 10 10 10 9 10
This is what I got so far... but the output is not what I am looking for.

Akzeptierte Antwort

Walter Roberson
Walter Roberson am 1 Mär. 2023
[~, minidx] = min(B, 1);
Now you want to delete row minidx(1), column 1, row minidx(2), column 2, row minidx(3), column 3, and so on.
  4 Kommentare

Melden Sie sich an, um zu kommentieren.

Weitere Antworten (0)

Produkte


Version

R2022b

Community Treasure Hunt

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

Start Hunting!

Translated by