필터 지우기
필터 지우기

csvwrite increment file name

조회 수: 1 (최근 30일)
Rusmaya Luthfina
Rusmaya Luthfina 2011년 11월 7일
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

답변 (1개)

Walter Roberson
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
Rusmaya Luthfina
Rusmaya Luthfina 2011년 11월 8일
rr, gg, bb would be a double array..
thx u Mr. Roberson
--Maya--
Walter Roberson
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 CenterFile Exchange에서 Whos에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by