Imshow not showing image on windows, but it works on mac

2 次查看(过去 30 天)
Hello,
I am trying to compare some data with a video using imshow. The goal is to go through the data and the video at the same time. A video is playing in subplot(2,1,1), while the algorithm goes through the data in subplot(2,1,2).There is a jpeg file of the plot in the attachment. A friend made a program that works on his mac, but the same matlab file doesn't work on my windows pc. We both use matlab 2015b.
My problem: The figure is not showing. I can stop the file from running and then the figure (attachment) pops up, but I can't see it while the file is running.
Here is some part of the file: (if you want i can put the whole file with the videos on a dropbox)
for k =1:5:700
%tic % start timer --> end = toc
subplot(2,1,1)
frame= read(VID,initialframe+k-1);
imshow(frame(y(1):y(2),x(1):x(2),:));
subplot(2,1,2)
hold on
xmarkers = begindata*fps + (k-1); %begindata = prompt%begin*fps+(k-1)+5*fps; %129.5 is zijn start
% place markers at these x-values; %2
ymarkers =currentdatanew(round(xmarkers));
plot(tnew,currentdatanew,'b',xmarkers/fps,ymarkers,'g*') %xmarkers begin!!
isgyr = 1;
xlim([xlimits_L(swimmer)+(k/fps),xlimits_H(swimmer)+(k/fps)-150])%xlimits_L(swimmer)+(k/fps)
ylim([-3.*isgyr,3.*isgyr])
hold off
end
I hope someone can help me. Thanks in advance!

回答(1 个)

Mike Garrity
Mike Garrity 2016-3-29
It sounds like you need a call to drawnow.

类别

Help CenterFile Exchange 中查找有关 Image Processing Toolbox 的更多信息

标签

产品

Community Treasure Hunt

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

Start Hunting!

Translated by