Clear Filters
Clear Filters

Program doesn't always start.

2 views (last 30 days)
Douglas Brenner
Douglas Brenner on 16 Sep 2016
Commented: Stephen23 on 17 Sep 2016
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 Comment
Stephen23
Stephen23 on 17 Sep 2016
"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.

Sign in to comment.

Answers (0)

Categories

Find more on Dates and Time 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!