Matlab 2022a on Linux hangs when plotting/saving figures
이전 댓글 표시
As titled, I tried to plot using the following script:
syms n
fplot(@(x) pi/4+symsum((1-(-1)^n)/(n^2*pi)*cos(n*x)+1/n*sin(n*x),n,1,15),[-15 15],'b')
ylim([-2 4])
xlabel('x')
ylabel('f(x)')
legend('k=15', 'Location', 'southeast')
I'd like to know if it is that this script is comuptational-intensive (I'm pretty new to Matlab) or is there something in Matlab that I need to configure to make it run faster. What I've experienced is as follows, along with my platform information:
Ubuntu 20.04.4, Intel Core i7-8565U CPU @ 1.8HGz x 8, 8GB RAM
After clicking the Run button to run the scropt above, I saw in the Command Window that the command returned quickly (within about one second) but the resulting figure window popped out only after several minutes. In the meantime, I saw one of my CPU core raised to 100% utilization (I saw this using `top').
After the figure showed up, I tried to save it as a PDF file, and that action took more than 15 minutes before the PDF file finally showed up in my folder.
I run my Matlab from the command-line prompt, with the following script:
#!/bin/bash
export LD_PRELOAD=/usr/lib/x86_64-linux-gnu/libstdc++.so.6
export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/usr/lib/x86_64-linux-gnu/dri/
export MESA_LOADER_DRIVER_OVERRIDE=i965
matlab -desktop
I saw error message "Failed to load module "canberra-gtk-module"" but from some other threads on the forum it seems that that error message causes no real harm.
Best regards,
Chao
채택된 답변
추가 답변 (0개)
카테고리
도움말 센터 및 File Exchange에서 Environment and Settings에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!