I need to import a database depending on an input argument.
조회 수: 1 (최근 30일)
이전 댓글 표시
If a user chooses 'x' as a parameter being studied, I would like to import the number 'x' is equal to as an excel database which contains the information to be analysed. Is this possible?
In example
How would I implement this to open the 203 database using the Bead1 definition. I have databases for all numbers shown e.g. 203.xlsx etc
% Acquired Bead SSC-H Median Values
Bead1 = 203;
Bead2 = 400;
Bead3 = 707;
Bead4 = 1019;
Bead5 = 1587;
댓글 수: 1
Walter Roberson
2016년 9월 6일
Should be merged into original question http://www.mathworks.com/matlabcentral/answers/301980-is-it-possible-to-use-an-argument-in-order-to-choose-which-excel-file-should-be-imported
채택된 답변
KSSV
2016년 9월 6일
Wit the given input value (Bead1), you make a filename and read it using xlsread.
Bead1 = 203 ;
filename = strcat(num2str(Bead1),'.xlsx') ; % this makes filename with extension .xlsx
data = xlread(filename) ; % read the file
댓글 수: 0
추가 답변 (0개)
참고 항목
카테고리
Help Center 및 File Exchange에서 Spreadsheets에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!