Borrar filtros
Borrar filtros

Using java.util.hashtable

4 visualizaciones (últimos 30 días)
Sam Da
Sam Da el 28 de Jun. de 2011
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?

Respuestas (0)

Categorías

Más información sobre Dictionaries en Help Center y File Exchange.

Etiquetas

Community Treasure Hunt

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

Start Hunting!

Translated by