MATLAB Answers

This statement is not inside any function. (It follows the END that terminates the definition of the function "extract_tiff".)

조회 수: 5(최근 30일)
EFSTATHIOS POLYDOROU
EFSTATHIOS POLYDOROU 31 May 2020
Could you please help with explanation. Thank you in advance.
I am trying to pass a file, but I keep getting this ERROR!
This statement is not inside any function.
(It follows the END that terminates the definition of the function "extract_tiff".)
function [] = extract_tiff()
[filename,pathname]=uigetfile({'*.avi';'*.mov'},'File Selector');
outPath = [pathname,'frame\'];
if ~exist(outPath,'dir')
mkdir(outPath)
end
mov = VideoReader([pathname,filename]);
k = 1;
images = readFrame(mov);
images=im2uint8(images);
outName=sprintf('cam_0_%06d.tif',k);
imwrite(images,[outPath,outName],'tiff');
% outName = sprintf('cam_0_%06d.tif',k);
% imwrite = images,[outPath,outName],'tiff');
k=k+1;
end
end

  댓글 수: 0

댓글을 달려면 로그인하십시오.

답변(1개)

per isakson
per isakson 31 May 2020
There are two end at the end of the function.
k=k+1;
end
end
Remove one of them

  댓글 수: 1

EFSTATHIOS POLYDOROU
The issue was that I had to put a while...thanks for your reply, highly appreciated

댓글을 달려면 로그인하십시오.

범주


Translated by