Matlab crashes when plotting!

조회 수: 7 (최근 30일)
Aditya Vaishya
Aditya Vaishya 2013년 7월 11일
댓글: Image Analyst 2015년 3월 25일
Here is a simple code to plot X,Y graph:
clear all; close all; fclose all; N=1000000; x=linspace(1,100,N); y=x.*x; plot(x,y,'o');
This program crashes Matlab when N is increased! But the same program runs if I have plot(x,y);
Any help? Thanks.

답변 (3개)

Jan
Jan 2013년 7월 11일
Please explain, what "crash" exactly mean: Do you get an error message?
You want to draw one million circles in a diagram? Beside the crash, do you assume that the resulting graphics could be useful to demonstrate anything?
Try to specify the renderer:
x = linspace(1, 100, 1e6);
y = x^2;
figure('Renderer', 'OpenGL');
opengl software
plot(x, y, 'o');
opengl hardware
plot(x, y, 'o');
figure('Renderer', 'ZBuffer');
plot(x, y, 'o');
figure('Renderer', 'Painters');
plot(x, y, 'o');
If only the OpenGL hardware method crashs, try to update the drivers of your graphics card.
  댓글 수: 4
Shruthi  Suresh
Shruthi Suresh 2015년 3월 25일
Hi, I'm facing the same problem. Whenever I try to run the plot function, my Matlab (2014b) crashes. I even changed the graphics card settings to OpenGL with no luck.
Image Analyst
Image Analyst 2015년 3월 25일
Shruti, see the FAQ.

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


Shashank Prasanna
Shashank Prasanna 2013년 7월 11일
Lets try to narrow down the issue.
Does this crash without the plot:
clear all
N=1000000;
x=linspace(1,100,N);
y=x.*x;
Or is it only with the plot?
  댓글 수: 1
Shashank Prasanna
Shashank Prasanna 2013년 7월 11일
Try changing the renderer as Jan mentioned.
figure('Renderer', 'Painters'); plot(x, y);
It that works, then restart matlab and run the following:
opengl software
That should resolve the issue.

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


Aditya Vaishya
Aditya Vaishya 2013년 7월 11일
Only when I plot.
  댓글 수: 1
Shashank Prasanna
Shashank Prasanna 2013년 7월 11일
Please see my comment on the above answer. Please try and keep replys to answers as comments and not as a dedicated answer.

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

카테고리

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