【RaspberryPi】树莓派Matlab/Simulink支持包安装与使用

官网支持与兼容性

Raspberry Pi Support from MATLAB - Hardware Support - MATLAB & Simulink

Raspberry Pi Support from Simulink - Hardware Support - MATLAB & Simulink

Matlab与树莓派兼容性

 Simulink与树莓派兼容性

树莓派Matlab&Simulink RaspberryPi支持包安装

安装方式一

        在进行安装之前,树莓派及环境必须具备以下条件:

  • 树莓派必须保证能够上网

  • 本次以CM4 Lite 无EMMC版本为例(为了只使用SD卡启动系统)或者树莓派4b

  • 系统原始镜像为2022-09-22-raspios-buster-armhf.img(仅适用于Buster系统下面这种安装方式)

  • Matlab版本为2023b或2024a

        1.在树莓派终端下面输入以下命令,安装适用于树莓派的安装包。

                $sudo apt-get update

                $sudo apt-get install matlab-rpi

       2. 执行配置树莓派命令,按终端中显示的设置步骤进行操作,全部输入y,同意安装或配置即可。

                $sudo matlab-rpi-setup

        3.输入并提供Matlab识别树莓派的名称。

        Provide a name for your Raspberry Pi in MATLAB Online.

        Name: myPi

        4.启用树莓派接口和服务。

        Do you want to enable I2C? (y/n): y

        Do you want to enable SPI? (y/n): y

        Do you want to enable camera? (y/n): y

        Do you want to enable UART? (y/n): y

        5. 选择启用或禁用将 MATLAB(®) 函数或 Simulink 模型部署到 Raspberry Pi

        Enable/disable deploying MATLAB Function/Simulink model to Raspberry Pi. Do you want to enable deploy MATLAB function/Simulink model as a standalone executable? (y/n): y

        Userland library is required to deploy MATLAB function/Simulink model to Raspberry Pi Hardware. Userland library is licensed to you by third parties under separate license terms available in the GitHub repository, https://github.com/raspberrypi/userland/

        Do you want to install userland? (y/n): y

        Paho MQTT C library is required to deploy MATLAB function/Simulink model to Raspberry Pi Hardware. Paho MQTT C library is licensed to you by third parties under separate license terms available in the GitHub repository, https://github.com/eclipse/paho.mqtt.c

        Do you want to install Paho MQTT? (y/n): y

        "nnpy" library is required to deploy MATLAB function/Simulink model to Raspberry Pi Hardware. nnpy python ibrary is licensed to you by third parties under separate license terms available in the GitHub repository, https://github.com/nanomsg/nnpy

        Do you want to install nnpy? (y/n): y

        6.选择启用或禁用将 Simulink 可自定义仪表板模块部署到 Raspberry Pi

        Enable/disable deploying Simulink customizable dashboard blocks on Raspberry Pi.

        Do you want to enable dashboard deployment workflow? (y/n): y

        Username used to login to the display session on the Raspberry Pi Hardware is required for dashboard deployment.

        Enter the username: pi

        Update display username success!

        Chromium-browser, required to deploy Simulink customizable dashboard blocks to Raspberry Pi Hardware will be installed as part of the setup.

        7.登陆Matlab账号验证连接。

        Provide your MathWorks Account credentials.

        Email Address or User ID: jsmith

        Password: *******

        8.重启树莓派。

        sudo reboot

        9.如果需要查看命令的详细描述可以在终端中输入下面的命令。

        man matlab-rpi-setup

安装方式二

        在进行安装步骤之前,需要将树莓派连上网,同时打开ssh服务,并设置用户名和密码。

        在Matlab管理附加功能里找到Simulink工具包的设置,并点击。

        选择当前使用的硬件。

        输入IP地址、用户名、密码,并测试连接。

        连接成功以后会进入到下一步,检查工具包是否安装的界面,检查完以后,点击INSTALL安装即可,根据不同的网络状况,安装时间大概在10-40左右,但是此种情况,会遇连接失败的问题,如果失败可以使用方法一安装,对于Bullseye系统只能在线安装完了,将镜像保存。

测试连接命令

        mypi=raspi('IP','pi','123456')

        例如,

        树莓派中有诸多资源可以使用,如下图,可以做很多控制应用,搭配第三方扩展板也可以做数据采集。

 

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                         

相关推荐

  1. 树莓 gpio 安装及简单使用

    2024-07-23 06:30:02       64 阅读
  2. 树莓5安装opencv

    2024-07-23 06:30:02       57 阅读
  3. 树莓安装mariadb & redis

    2024-07-23 06:30:02       46 阅读
  4. 树莓docker安装lnmp

    2024-07-23 06:30:02       17 阅读

最近更新

  1. docker php8.1+nginx base 镜像 dockerfile 配置

    2024-07-23 06:30:02       52 阅读
  2. Could not load dynamic library ‘cudart64_100.dll‘

    2024-07-23 06:30:02       54 阅读
  3. 在Django里面运行非项目文件

    2024-07-23 06:30:02       45 阅读
  4. Python语言-面向对象

    2024-07-23 06:30:02       55 阅读

热门阅读

  1. Python面试整理-字符串处理

    2024-07-23 06:30:02       13 阅读
  2. SQL中的函数

    2024-07-23 06:30:02       16 阅读
  3. Logback 配置文件加载步骤

    2024-07-23 06:30:02       15 阅读
  4. Ubuntu 20.04搭建OpenCV 4.5.0 & C++环境

    2024-07-23 06:30:02       13 阅读
  5. 定制Mojo模型的魔法:特征转换的艺术

    2024-07-23 06:30:02       17 阅读
  6. 自定义预测逻辑:Mojo模型的高级应用

    2024-07-23 06:30:02       17 阅读
  7. Mojo模型动态批处理:智能预测的终极武器

    2024-07-23 06:30:02       17 阅读
  8. Android 自定义系统版本号

    2024-07-23 06:30:02       12 阅读
  9. 曼哈顿距离与切比雪夫距离

    2024-07-23 06:30:02       16 阅读
  10. 技术文档总结----思维导图

    2024-07-23 06:30:02       17 阅读
  11. C语言强化-1.数据结构概述

    2024-07-23 06:30:02       15 阅读
  12. 【Go程序】爬虫获取豆瓣Top250

    2024-07-23 06:30:02       14 阅读