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에서 Whos에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!