For whose who need to export to Metastock format
Step 1: output to text format, see the example
% format AAM,20100913,24.40,24.90,23.70,24.00,13600,0
fid = fopen('scindex.txt','w');
for i=1:size(SCIndex)
sdate=datestr(TDate(i),'yyyymmdd');
fprintf(fid, 'SCINDEX,%s,%.2f,%.2f,%.2f,%.2f,0\n',sdate,SCIndex(i),SCIndex(i),SCIndex(i),SCIndex(i));
end
fclose(fid);
Then call external program to convert the text file to MS. asc2ms can be found easily by google.