Am I using this syntax correctly?

1 次查看(过去 30 天)
Biza Ferreira
Biza Ferreira 2012-10-8
I created the following code to obtain the results saved in various formats, am I doing it correctly.
file1='/Users/armandoferr/Documents/MATLAB/images_sofia.xls';
file2='/Users/armandoferr/Documents/MATLAB/images_sofia.xlsx';
file3='/Users/armandoferr/Documents/MATLAB/images_sofia.txt';
data = cell(newDimensao+1,3);
data(1,:)={'N. Imagem', 'Nome da Imagem', 'Data da Conversao'};
data(2:end,1) = {x};
data(2:end,2) ={imgDir(x).name};
data(2:end,3) =cellstr(repmat(datestr(now,'dd/mm/yyyy'),newDimensao,1));
xlswrite(file1,data);
xlswrite(file2,data);
dataNow = datestr(now,'dd/mm/yyyy');
ficheiro=fopen(file3,'w');
fwrite(ficheiro,'N. Imagem ','Nome Imagem','Data da Convers?ao');
fwrite(ficheiro,x,imgDir(x).name, dataNow);
fclose(ficheiro);
tanks
I want to save each cell data from array like this example:
N. Image Name Image Peaces Date Convertion
#1 100071.jpg 3 06/10/2012
#2 100072.jpg 5 06/10/2012
#3 100073.jpg 1 06/10/2012
#4 100074.jpg 9 06/10/2012
#5 100075.jpg 8 06/10/2012
#6 100076.jpg 4 06/10/2012
#7 100077.jpg 6 06/10/2012

回答(2 个)

Image Analyst
Image Analyst 2012-10-9
Wouldn't you know if you just opened those files and see if they look like you want them to look? As far as syntax goes, the mlint error check will tell you with a red line and squiggled underline, and in addition, you'll get an error upon running if the syntax is incorrect. Since you didn't list any errors, I assume that there is no syntax error.

Biza Ferreira
Biza Ferreira 2012-10-9
tanks, for answer the question , the problem is I write this code for save in each cell data ,but i dont understand what i am doing wrong

产品

Community Treasure Hunt

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

Start Hunting!

Translated by