Using java.util.hashtable
4 Ansichten (letzte 30 Tage)
Ältere Kommentare anzeigen
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 Kommentare
Antworten (0)
Siehe auch
Kategorien
Mehr zu Dictionaries finden Sie in Help Center und File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!