how can i export datas from excel and let matlab run it. the excel has names of students and their grades. i have this code for the gading but dont know how to go about itin excel... please what is the best way of going about this?
1 vue (au cours des 30 derniers jours)
Afficher commentaires plus anciens
function test_score test_score=input('Enter the test score:'); if((0>test_score)|(test_score>100)) disp('This is not a possible score in my class') elseif((test_score>=90)|(test_score>=100)) disp('A') elseif((test_score>=80)|(test_score>=89)) disp('B') elseif((test_score>=70)|(test_score>=79)) disp('C') elseif((test_score>=60)|(test_score>=69)) disp('D') else disp('F') end
0 commentaires
Réponse acceptée
Silke
le 6 Déc 2012
If you want to do this in Matlab you can use xlsread to import the data in Matlab:
name = xlsread('filename', 'sheet', 'range1'); test_score = xlsread('filename', 'sheet', 'range1');
instead of using the "disp" write the grade in a vector and than write this vector into your xls-file by using
xlswrite('filename','vectorname','sheetname','range')
range is something like A1:A100 You should use cells that are empty
0 commentaires
Plus de réponses (0)
Voir également
Catégories
En savoir plus sur Data Export to MATLAB dans Help Center et File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!