Why does MATLAB crash when plotting?

Hi, I am learning Matlab and am running a simple script. In particular, I don't why but for a few days when plotting, Matlab 2021a is unreasonably slow and crash on my PC (Itel core i7 CPU 2.50 Ghz RAM 8 GB).
I am trying a simple plot:
plotData(X, y);
>> sz = size(X)
sz =
118 2
>> sz = size (y)
sz =
118 1
Any ideas?
Thanks

댓글 수: 7

Michele Mingione
Michele Mingione 2021년 3월 21일
편집: Michele Mingione 2021년 3월 21일
From here, a data set of a course in machine learning from coursera. I attached it. No messagge because when I try plotting matlab remains in state "busy" and if i don't stop with ctrl+c all crash not only matlab but all PC. However, if I stop the run plotting, Matlab creates many similar figure. Only for a few days, I have this problem and i don't why
Hi Michele,
Which example in the example folder is it?
From the sounds of it the plot function has been included in a very large for loop. MATLAB states that it is "busy" because it is still trying to draw many, many graphs, after a period of time it runs out of RAM and crashes the PC.
Drawing graphs in any program is computationally intensive. Try to stop the plotting and instead collate the data into one final (singular) plot. This should be less intensive to plot.
Hope this helps,
Christopher
Walter Roberson
Walter Roberson 2021년 3월 21일
"To help you get more familiar with plotting, we have left plotData.m empty so you can try to implement it yourself. "
Please show how you implemented plotData.m
Image Analyst
Image Analyst 2021년 3월 21일
Please attach all the m-files and data files we need to run your code and reproduce the problem.
The variable X has two columns, which column do you want to plot against Y?
vs Y?

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

답변 (2개)

Arthi Sathyamurthi
Arthi Sathyamurthi 2021년 3월 24일

0 개 추천

My initial analysis indicates this crash was the result of a known issue. You can refer to the following question for resolution steps.
Michele Mingione
Michele Mingione 2021년 4월 3일

0 개 추천

It seems to work, now.
There was a mistake with my code plotData(X, y) when saving it. Matlab tried to draw many, many graphs and after a period of time it runs out of RAM and crashes the PC. I fixed it. My fault, sorry

카테고리

도움말 센터File Exchange에서 Startup and Shutdown에 대해 자세히 알아보기

질문:

2021년 3월 21일

답변:

2021년 4월 3일

Community Treasure Hunt

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

Start Hunting!

Translated by