clc,clear
% tic .... toc 用来统计运行时间
%tic
%% 其他加载数据的命令: load "data.dat"
%字符转换:
% % % % % % 1、cell2mat:将cell转换为mat的char型
% % % % % % 2、str2num:将mat从char转换为double型
% % % % % % 3、cellstr:将char转cell
% % % % % % 4、num2str:将double转char
% % % % % % 5、num2cell:将double直接转cell
[num,txt,raw]=xlsread('C:\Users\leo\Desktop\DesmondOkello\Data\tbl_stock(new).xls'); %num接收读取的数值数据, txt为cell类型,读取字符,raw为cell类型,能同时读取字符或者数字
matrix_col=size(txt,2)
matrix_row=size(txt,1)
result=[];
%Westinghouse Clip-On Gooseneck Lamps:
%Tennsco 6- and 18-Compartment Lockers
%Flat Face Poster Frame
%Acme Value Line Scissors
temp=1;
itemname='Acme Value Line Scissors';%'Westinghouse Clip-On Gooseneck Lamps';
for n=2:matrix_row
%if char(b())==itemname
name=char(txt(n,10));
%disp(name)
if length(name)==length(itemname) % 必须先判断长度,因为matlab中 name==itemname 要求两者