Using java.util.hashtable

조회 수: 3 (최근 30일)
Sam Da
Sam Da 2011년 6월 28일
This is what I have for code:
sheetName='Sheet2';
[numbers, strings] = xlsread('TestSheet.xlsx', sheetName);
strings(1,:) = [];
strings(:,2) = [];
strings = char(strings);
strings;
phone_book = java.util.Hashtable;
for i=1:size(strings,1)
c2 = sprintf('%s',strings(i,:));
n2=numbers(i,1);
phone_book.put(c2,n2);
end
c3 = 'EXAS';
phone_number = phone_book.get(char(c3))
And the contents of TestSheet.xlsx are:
symbol openingsize SIMO 2950 PVTB 1639 CBRX 2419 AFFY 2401 VRUS 3868 ARAY 2824 BMTI 2155 ROIAK 2691 CNQR 1357 EXAS 2956
When I try to read number corresponding to EXAS I get []. Where is the problem?

답변 (0개)

카테고리

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

태그

Community Treasure Hunt

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

Start Hunting!

Translated by