Program doesn't always start.

3 次查看(过去 30 天)
Douglas Brenner
Douglas Brenner 2016-9-16
评论: Stephen23 2016-9-17
My program doesn't always run. I access my license through a VPN. Could that have something to do it with? Here's the code.
clear
include
for i = 3:3%1:nimages;
aviin = [transformeddir,base_name,'_transformed_', int2str(i),'.avi'];
disp('Converting')
disp(aviin)
a = VideoReader(aviin)
n_frames = a.NumberOfFrames;
frame=read(a,1);
Sum=double(frame);
for j = 2:n_frames;
frame = double(read(a,j));
Sum = Sum + frame;
end
Mean = Sum / n_frames;
figure(1), imshow(uint8(Mean));
[Gmag, Gdir] = imgradient(Mean,'prewitt');
rgbmag = ind2rgb(uint8(3*Gmag), flipud(jet(256)));
rgbdir = ind2rgb(uint8(Gdir), hsv(256));
figure(2);
imshow(rgbmag);
figure(3);
imshow(rgbdir);
end
  1 个评论
Stephen23
Stephen23 2016-9-17
"My program doesn't always run"
So what does it do? Does MATLAB print an error message or a warning, crash, go into an endless loop, quit without warning, show an incorrect output, or does your computer explode into flames?
Each of these can have different causes, so when you actually tell us exactly what is happening then we can actually help you. Until then you make us guess what "doesn't always run" means: I will interpret it to mean that your computer is tired and wants to go on holiday. The solution is thus to give it a massage and book it a week in the Bahamas.

请先登录,再进行评论。

回答(0 个)

类别

Help CenterFile Exchange 中查找有关 Dates and Time 的更多信息

标签

Community Treasure Hunt

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

Start Hunting!

Translated by