필터 지우기
필터 지우기

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

채택된 답변

Silke
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개)

카테고리

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

Community Treasure Hunt

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

Start Hunting!

Translated by