targetHardware
Configuration object for hardware
Description
This object represents a configuration object for the hardware. Create this object
by using the targetHardware
function. Use this object with the deploy
function to deploy a MATLAB® function as a standalone executable on the hardware.
Creation
Description
creates a configuration object for the hardware. You can deploy your MATLAB function as a standalone executable on the hardware by using this object
with the targetObj
= targetHardware(hardwareName
)deploy
method.
Input Arguments
hardwareName
— Name of hardware
hardware name
Name of the hardware on which the MATLAB function is to be deployed.
Example: 'Raspberry Pi'
Data Types: char
Output Arguments
targetObj
— Configuration object of the hardware
targetHardware
object
The configuration object of the specified hardware, returned as a targetHardware
object.
Properties
Name
— Hardware name
hardware name
This property is read-only.
The name of the hardware on which the MATLAB function is to be deployed.
Example: Raspberry Pi
Data Types: char
DeviceAddress
— IP address or host name
IP address
The IP address or host name of the Ethernet port on the hardware. In MATLAB
Online™, DeviceAddress
is the SerialNumber
of the hardware as displayed by raspilist
.
Example:
169.254.0.2
Data Types: char
UserName
— Hardware user name
pi
(default)
The user name for the Linux® operating system on the hardware.
Example:
pi
Data Types: char
Password
— Hardware password
raspberry
(default)
The password for the Linux operating system on the hardware.
Note
The default user is pi
, and the password is
raspberry
. This user has sudo root powers at the command line.
Changing this default password to a stronger password is a good security
practice.
Example:
raspberry
Data Types: char
BuildDir
— Hardware build folder
/home/pi
(default)
The folder on the hardware where the MATLAB function is deployed. This folder contains a symbolic link to the deployed
executable. For example, if you specify BuildDir
as
/home/pi
, the support package adds a folder structure,
/MATLAB_ws/R2020a
, inside your BuildDir
, where
MATLAB_ws
is the workspace directory and R2020a
is the release version of MATLAB. This folder contains a symbolic link that points to the actual location
of the deployed executable.
Example: /home/pi
Data Types: char
BuildAction
— Build action to perform
Build, load, and run
(default) | Build
Defines how MATLAB responds when you press Ctrl+B
to build your model.
Build
: MATLAB compiles and links the MATLAB function into an executable with libraries. This option does not load and run the executable on the hardware board.Build, load, and run
: MATLAB compiles and links the MATLAB function into an executable with libraries, loads the executable and libraries, and runs the executable on the hardware.
Example:
Build, load, and run
Data Types: char
Object Functions
deploy | Deploy MATLAB function on hardware |
Examples
Create Configuration Object for Hardware
Note
This example is applicable to the installed MATLAB Support Package for Raspberry Pi® Hardware.
Create a configuration object of the Raspberry Pi hardware.
targetObj = targetHardware('Raspberry Pi')
targetObj = targetHardware with properties: Name: 'Raspberry Pi' DeviceAddress: '172.18.182.234' Username: 'pi' Password: '*********' BuildDir: '/home/pi' EnableRunOnBoot: 0 BuildAction: 'Build, load, and run' CoderConfig: [1×1 coder.CodeConfig]
Create Configuration Object for Hardware in MATLAB Online
Create a configuration object of the Raspberry Pi hardware in MATLAB Online
targetObj = targetHardware('Raspberry Pi')
board = targetHardware with properties: Name: 'Raspberry Pi' DeviceAddress: '0000000096843414' Username: '' Password: '' BuildDir: '/home/matlabrpi' EnableRunOnBoot: 0 BuildAction: 'Build, load, and run' CoderConfig: [1x1 coder.CodeConfig]
Extended Capabilities
C/C++ Code Generation
Generate C and C++ code using MATLAB® Coder™.
Deploy your MATLAB function as a standalone executable on the Raspberry Pi hardware using
targetHardware
in MATLAB Online.
Version History
Introduced in R2018b
See Also
MATLAB 명령
다음 MATLAB 명령에 해당하는 링크를 클릭했습니다.
명령을 실행하려면 MATLAB 명령 창에 입력하십시오. 웹 브라우저는 MATLAB 명령을 지원하지 않습니다.
Select a Web Site
Choose a web site to get translated content where available and see local events and offers. Based on your location, we recommend that you select: .
You can also select a web site from the following list:
How to Get Best Site Performance
Select the China site (in Chinese or English) for best site performance. Other MathWorks country sites are not optimized for visits from your location.
Americas
- América Latina (Español)
- Canada (English)
- United States (English)
Europe
- Belgium (English)
- Denmark (English)
- Deutschland (Deutsch)
- España (Español)
- Finland (English)
- France (Français)
- Ireland (English)
- Italia (Italiano)
- Luxembourg (English)
- Netherlands (English)
- Norway (English)
- Österreich (Deutsch)
- Portugal (English)
- Sweden (English)
- Switzerland
- United Kingdom (English)