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 回表示 (過去 30 日間)
古いコメントを表示
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 件のコメント
採用された回答
Silke
2012 年 12 月 6 日
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 件のコメント
その他の回答 (0 件)
参考
カテゴリ
Help Center および File Exchange で Data Export to MATLAB についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!