Rembering the day when I am a freshman ......
字符串数组。
>> a=['hello'; 'world'] ;
>> a(1)
ans =
h
>> a(1,:)
ans =
hello
2.链接字符串
combinedStr = strcat(s1, s2, ..., sN)
horizontally concatenates strings in arrays s1, s2, ..., sN. Inputs can be combinations of single strings, strings in scalar cells, character arrays with the same number of rows, and same-sized cell arrays of strings. If any input is a cell array, combinedStr is a cell array of strings. Otherwise, combinedStr is a character array.
3. 得到矩阵的某一行
A(1,:)
莫一列 A(:,1)
4 if
%%%%%%%%%%%%%%%%%%%%%%
clear all;
y=[];
versions=['1.1';'1.2';'1.3';'2.1';'2.2';'2.3'];
fprefix='nehalem_';
fsuffix='_time';
for i=1:5
file=strcat(fprefix,versions(i,:),fsuffix);
file;
fid=fopen(file,'r');
ytmp=fscanf(fid,'%f',inf);
%y(:,i)=ytmp
%rate=y(:,1)./ytmp; %the first column
%y=[y rate];
if i>1
y(:,i)=y(:,1)./ytmp;
else
y(:,i)=ytmp;
end
size(ytmp);
fclose(fid);
end
for i=1:41
y(i,1)=1;
end
size(y)
bar(y);
wuwu....
阅读(860) | 评论(0) | 转发(0) |