入れ子関数での反復計算、ループのさせ方
Show older comments
フォルダ内にある画像ファイルを読み込んで、指定サイズに分割するコードを考えています。
jpegFiles = dir('*.jpg');
numfiles = length(jpegFiles);
mydata = cell(1, numfiles);
for k = 1:numfiles
mydata{k} = imread(jpegFiles(k).name);
end
画像の読み込みまでは、分かったのですが、 このコードのfor文を書き換えて、入れ子関数から、以下のようなコードを入れて画像を分割したいと考えています。
fun=@(bs) imwrite(bs.data,...
['./', int2str(bs.location(1)), '_', int2str(bs.location(2)), '.jpg']);
blockproc(mydata,[200 200] , fun);
入れ子関数で反復計算を行うにはどうするのが良いのでしょうか? よろしくお願い致します。
Accepted Answer
More Answers (0)
Categories
Find more on プログラミング in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!