• ubuntu20.04 安装 matlab R2023b


    起因

    闲着没事,想在ubuntu上安装matlab。

    步骤

    这个博客写得很好,我就不赘述了:参考博客 。但有点不一样:我现在matlab官网上下载的linux版本不是iso镜像文件,直接是一个zip压缩文件,不用什么挂载了。直接解压缩,然后再运行install文件。后面可以直接点击图标运行matlab。

    问题

    问题1

    运行matlab会报错:

    Gtk-Message: 15:46:15.337: Failed to load module "canberra-gtk-module"
    
    • 1

    这篇博客分析的很清楚:参考博客
    执行这两步就行了:

    sudo apt-get install libcanberra-gtk-module -y
    
    • 1
    sudo ln -s /usr/lib/x86_64-linux-gnu/gtk-2.0/modules/libcanberra-gtk-module.so /usr/lib/libcanberra-gtk-module.so
    
    
    • 1
    • 2

    问题2

    在matlab窗口中可以看到这样的提示:

    com.jogamp.opengl.GLException: X11GLXDrawableFactory - Could not initialize shared resources for X11GraphicsDevice[type .x11, connection :0, unitID 0, handle 0x0, owner false, ResourceToolkitLock[obj 0x535b6672, isOwner false, <15a2f11f, 7c843551>[count 0, qsz 0, owner ]]]
    at jogamp.opengl.x11.glx.X11GLXDrawableFactory$SharedResourceImplementation.createSharedResource(X11GLXDrawableFactory.java:326)
    at jogamp.opengl.SharedResourceRunner.run(SharedResourceRunner.java:297)
    at java.lang.Thread.run(Unknown Source)
    Caused by: com.jogamp.opengl.GLException: glXGetConfig(0x1) failed: error code Unknown error code 6
    at jogamp.opengl.x11.glx.X11GLXGraphicsConfiguration.glXGetConfig(X11GLXGraphicsConfiguration.java:570)
    at jogamp.opengl.x11.glx.X11GLXGraphicsConfiguration.XVisualInfo2GLCapabilities(X11GLXGraphicsConfiguration.java:500)
    at jogamp.opengl.x11.glx.X11GLXGraphicsConfigurationFactory.chooseGraphicsConfigurationXVisual(X11GLXGraphicsConfigurationFactory.java:434)
    at jogamp.opengl.x11.glx.X11GLXGraphicsConfigurationFactory.chooseGraphicsConfigurationStatic(X11GLXGraphicsConfigurationFactory.java:240)
    at jogamp.opengl.x11.glx.X11GLXDrawableFactory.createMutableSurfaceImpl(X11GLXDrawableFactory.java:524)
    at jogamp.opengl.x11.glx.X11GLXDrawableFactory.createDummySurfaceImpl(X11GLXDrawableFactory.java:535)
    at jogamp.opengl.x11.glx.X11GLXDrawableFactory$SharedResourceImplementation.createSharedResource(X11GLXDrawableFactory.java:283)
    ... 2 more
    
    • 1
    • 2
    • 3
    • 4
    • 5
    • 6
    • 7
    • 8
    • 9
    • 10
    • 11
    • 12
    • 13

    这篇博客给出了解决办法参考博客
    也就是先这样启动matlab:

    ./matlab -softwareopengl
    
    • 1

    再在matlab命令行中执行:

    opengl('save','software')
    
    • 1

    然后退出。以后直接运行./matlab也不会出现上述报错了。

    问题3

    记录一下:
    在这里插入图片描述
    我选了否,如果以后出问题,来这里排查。
    目前没碰到问题,在软件中找到matlab图标,点击就能运行,很方便。以后遇到matlab,不用再回到windows了~
    在这里插入图片描述

  • 相关阅读:
    基于Springboot外卖系统19:用户地址+默认收货地址
    odoo16 档案管理中的视频档案的上传与播放
    基础算法相关笔记
    Java设计模式之策略模式
    荐书丨《好奇心的秘密》:一个针尖上可以站多少跳舞的小天使?
    通过路由器监控,优化网络效率
    CSV文件的读写
    Unity3d shader实现消融效果
    TensorRT安装记录(8.2.5)
    IntelliJ IDEA 2023 年下载、安装教程、好用插件推荐
  • 原文地址:https://blog.csdn.net/qq_51289776/article/details/136258209