Computer freezes SOMETIMES when plotting

조회 수: 30 (최근 30일)
Maurizio
Maurizio 2016년 5월 2일
댓글: Maurizio 2016년 5월 4일
Sometimes when I use the plot command my computer freezes, meaning that my computer does not respond to my mouse or my keyboard. In this case, I have to turn off the computer with the power button, without having the chance to save any open documents.
I am working with a Linux OS.
Since it just happens sometimes, i.e., I can plot the same graph a few times before my computer freezes, I have no idea where the error comes from, and I do not know what additional information I should provide.
  댓글 수: 2
CS Researcher
CS Researcher 2016년 5월 2일
Are there multiple plot commands? Are you using the plot command in a loop? Share your work to get a better answer.
Maurizio
Maurizio 2016년 5월 4일
No, there are neither multiple plot commands nor loops. But I am sure it could also happen in a loop or when I use multiple plot commands. The problem with a sample code is that this code will run on my computer most of the time but sometimes it will not. For example, today I was able to run the following code 8 times before my computer freezed. Two days age it happend after around 15 times.
n=rand(4)
hr_mc = n(:,1);
hr_ms = n(:,2);
hr_fs = n(:,3);
hr_all = n(:,4);
x = [1,2,3,4];
figure(1)
plot(x,hr_all,'--o',x,hr_mc,'--x',x,hr_ms,'--s',x,hr_fs,'--d');
axis([0.5 4.5 0 0.8]);
xlabel('Age');
ylabel('HR rate');
legend('All','Married','Single male','Single female','Location','southoutside');
neworder = {
'below 29'
'29 to 39'
'40 to 49'
'above 49'};
set(gca,'XTick',[1 2 3 4]);
set(gca,'XTickLabel',neworder);
Instead of using n=rand(4) in the beginning of the code, I load data from an excel sheet using the xlsread command.

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

답변 (1개)

Mike Garrity
Mike Garrity 2016년 5월 2일
If it only happens when you plot, then the first suspect would be the driver for the graphics card. I would look to see whether there's a newer driver available for your card. This page in the doc provides a lot of info on how to track this sort of problem down.
The command
opengl info
will capture most of the information about the card and driver. That will probably be helpful.
The command
opengl software
or the
-softwareopengl
startup flag will tell MATLAB not to use the graphics card for much beyond pushing pixels into the framebuffer. This might be useful while you debug the problem.

카테고리

Help CenterFile Exchange에서 Graphics Performance에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by