csvwrite increment file name
1 回表示 (過去 30 日間)
古いコメントを表示
hi everyone,
i have problem with this code
clear all;
f = 'F:/Maya/pengenalan pola/tugas image retrieve/image';
fileList = dir(fullfile(f,'*.jpg'));
path_save = 'F:/Maya/pengenalan pola/tugas image retrieve/data pixel';
for i = 1:length(fileList)
I{i} = imread((fullfile(f,fileList(i).name)));
out{i} = mat2cell(I{i}, ones(120/60,1)*60, ones(120/60,1)*60, 3);
[ra{i} rb{i} rc{i}] = cellfun(@(x) unique(x(:,:,1)), out{i} , 'un', 0);
[ga{i} gb{i} gc{i}] = cellfun(@(x) unique(x(:,:,2)), out{i} , 'un', 0);
[ba{i} bb{i} bc{i}] = cellfun(@(x) unique(x(:,:,3)), out{i} , 'un', 0);
rr = csvwrite(['r' num2str(i) '.txt'],rc{i});
gg = csvwrite(['g' num2str(i) '.txt'],gc{i});
bb = csvwrite(['b' num2str(i) '.txt'],bc{i});
end
returns error
??? Error using ==> csvwrite Too many output arguments.
Error in ==> histogram at 22 rr = csvwrite(['r' num2str(i) '.txt'],rc{i});
how can i fix this?? really need ur helps, plzzz :(
Maya
0 件のコメント
回答 (1 件)
Walter Roberson
2011 年 11 月 7 日
<http://www.mathworks.com/help/techdoc/ref/csvwrite.html csvwrite>() does not output anything. What output value were you expecting that you would store in rr, gg, or bb ?
2 件のコメント
Walter Roberson
2011 年 11 月 8 日
What double array are you expecting in each case? csvwrite() writes out data, so if it did return anything at all, the sorts of thing it would return might be error codes or counts of the items written or something similar.
If you are expecting that rr and so on would be assigned the data written, then do not try to assign them the output of csvwrite(): just assign rr = rc{i}; gg = gc{i}; bb = bc{i};
参考
カテゴリ
Help Center および File Exchange で Audio and Video Data についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!