Why is matlab plot function not working with matlab 2018a?

3 ビュー (過去 30 日間)
Sony Varghese
Sony Varghese 2018 年 9 月 20 日
回答済み: Daksh 2023 年 2 月 2 日
I wrote the following program and though the figure window opens, the plot doesn't come up.
t=1:1:10
x1= (-1/4)*exp(-2*t)+(1/8)*exp(-4*t)+1/8;
x2=(1/2)*exp(-2*t)-(1/2)*exp(-4*t);
subplot(2,1,1)
plot(t,x1(t))
subplot(2,1,2)
plot(t,x2(t))
I tried a different program from matlab examples, it did not work for that too:
x=-10:.1:10;
y=sin(x);
plot(x,y)
  1 件のコメント
KALYAN ACHARJYA
KALYAN ACHARJYA 2018 年 9 月 20 日
編集済み: KALYAN ACHARJYA 2018 年 9 月 20 日
Can you share the screenshot of the code and error you have got?

サインインしてコメントする。

回答 (1 件)

Daksh
Daksh 2023 年 2 月 2 日
I understand you're experiencing issues with MATLAB plot() function in R2018b. Personally on my PC the following plots show up without any issues, however you could be experiencing issues for many reasons:
MATLAB can encounter low-level issues when creating graphics on your system; often due to older graphics hardware or outdated graphics drivers. To resolve them, try the options described here:
Upgrade Your Graphics Hardware Drivers
Graphics hardware vendors frequently provide updated graphics drivers that improve hardware performance. To help ensure that your graphics hardware works with MATLAB, upgrade your graphics drivers to the latest versions available.
  • On Windows systems, check for driver updates on the website of your manufacturer. If no updates are provided, then check the website of your graphics hardware vendor.
  • On Linux systems, use proprietary vendor drivers instead of open-source replacements.
  • On Macintosh systems, the graphics drivers are part of the operating system. Use the latest updates provided.
Use graphics hardware that supports a hardware-accelerated implementation of OpenGL 2.1 or later. Most graphics hardware released since 2006 has OpenGL 2.1 or later. If you have an earlier version of OpenGL, most graphics features still work, but some advanced graphics features are unavailable. For the best performance, OpenGL 4.0 or later is recommended. For more information on determining your graphics hardware, see rendererinfo.
Choose a Renderer Implementation for Your System
MATLAB displays graphics using a hardware-accelerated, basic hardware-accelerated, or software implementation of the graphics renderer. By default, MATLAB tries to use a hardware-accelerated implementation if your graphics hardware supports it. You can work around many graphics issues by switching to either a software implementation or a basic hardware-accelerated implementation. These alternate implementations do not support some advanced graphics features.
In some cases, MATLAB automatically switches to a software implementation:
  • If your system does not have the necessary graphics hardware.
  • If you are using a graphics driver with known issues, an older graphics driver, or graphics virtualization. Update your graphics drivers to the latest versions available.
  • If a previous MATLAB session crashed due to a graphics issue. If the previous session was using software OpenGL and crashed, then subsequent sessions use a more stable version of software OpenGL that has fewer capabilities.
The availability of hardware-accelerated graphics when using remote desktop on Windows systems varies. If you try to use hardware-accelerated graphics when it is not supported, MATLAB returns a warning message and uses software OpenGL instead. It is possible that updating your graphics drivers to the latest versions will enable support for hardware-accelerated graphics.
To determine which implementation MATLAB is using, call the rendererinfo function. For example, this command gets the information for the current axes and stores it in a structure called info.
info = rendererinfo(gca)
Specify OpenGL Implementation for Current Session
To specify an OpenGL implementation for the current session of MATLAB, use one of these techniques.
  • Software OpenGL — Start MATLAB from the command prompt on your system using the command:
matlab -softwareopengl
  • This command works only on Windows and Linux systems. Macintosh systems do not support software OpenGL.
  • Basic hardware-accelerated OpenGL — Type opengl hardwarebasic at the MATLAB command prompt.
  • Hardware-accelerated OpenGL — Type opengl hardware at the MATLAB command prompt.
Fix Out-of-Memory Issues
Graphics hardware with limited graphics memory can cause poor performance or lead to out-of-memory issues. Improve performance and work around memory issues with these changes:
  • Use smaller figure windows.
  • Turn off anti-aliasing by setting the GraphicsSmoothing property of the figure to 'off'.
  • Do not use transparency.
  • Use software OpenGL.
Hope this helps!

カテゴリ

Help Center および File ExchangeGraphics Performance についてさらに検索

タグ

製品


リリース

R2018a

Community Treasure Hunt

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

Start Hunting!

Translated by