Code covered by the MathWorks Limited License

Highlights from
Simulink Support Package for LEGO MINDSTORMS NXT hardware (R2012a)

5.0 | 2 ratings Rate this file 59 Downloads (last 30 days) File Size: 2.27 MB File ID: #35206 Version: 1.14
image thumbnail

Simulink Support Package for LEGO MINDSTORMS NXT hardware (R2012a)



23 Feb 2012 (Updated )

Simulink block library for creating models that run directly on yourLEGO MINDSTORMS NXT robot

Editor's Notes:

This file was selected as MATLAB Central Pick of the Week

| Watch this File

File Information

LEGO MINDSTORMS NXT ( is a robotics invention system for creating and controlling robots using programmable motors and sensors.
With R2012a, Simulink provides built-in support for prototyping, testing, and running models on LEGO MINDSTORMS NXT robots. You can design algorithms in Simulink for control systems and robotics applications then see them perform with hardware.
To install support for LEGO MINDSTORMS NXT, at the MATLAB command prompt, type "targetinstaller". Target Installer opens.

• If you did not download the support package, choose Internet. Target Installer automatically downloads and installs the support package.

• If you did download the support package, choose Folder. After you specify a location, Target Installer installs this support package.

Simulink support for LEGO MINDSTORMS NXT includes the following I/O driver blocks:
• Microphone and speaker
• Input sensors, including light, color, touch, and ultrasonic
• Output sensors, such as servo motor and LCD
• Send and receive using Bluetooth wireless connections between multiple LEGO MINDSTORMS NXT robots

This FileExchange entry is for R2012a support.

For more information on LEGO MINDSTORMS NXT support, see:

For more information on built-in hardware support, see:

Required Products Simulink
MATLAB release MATLAB 7.14 (R2012a)
MATLAB Search Path
Other requirements Simulink Support for LEGO MINDSTORMS NXT requires Microsoft Windows.
Tags for This File   Please login to tag files.
Please login to add a comment or rating.
Comments and Ratings (15)
10 Jan 2014 Mehdi

Mehdi (view profile)

Hi, I have to use RFID sensor in my hardware which is not supported by simulink. Do you have any idea to add this sensor in simulink? Thanks,

Comment only
18 Nov 2013 Xantopp

Hi all,
got same Problem as federica, installatio hangs after (successful) install of 7zip in cygwin step, details below...
Any Help??

OS: Win7 HW:
MB: setup-x86-64.exe funktioniert nicht mehr (... stopped working, Collecting info...)
MB: ... sending info...
MB: long protokoll...
getUrlToStream failed!
get_url_to_membuf failed!
getUrlToStream failed!
get_url_to_membuf failed!
getUrlToStream failed!
get_url_to_membuf failed!
getUrlToStream failed!
get_url_to_membuf failed!
mbox note: Unable to get setup.ini from <>
unattended_mode is set at mbox: returning default value
download/verify error in unattended_mode: out of retries
note: Installation incomplete. Check C:\MATLAB\SupportPackages\R2013a\downloads\Cygwin\setup.log.full for details
Ending cygwin install

Comment only
10 Nov 2013 Jingyu Xiang

I am trying to install this support package but I got an error. The error says that "There is no target information file about LEGO MINDSTORMS NXT rrt_lego_mindstorms_nxt_info." (Because my matlab is in Japanese, the error massage is not correct in Engilish.) Could anyone tell me what I should do ?

Comment only
29 Oct 2013 Gautam Vallabha

Johanna, what platform are you on? This support package is only for Windows. Also, on Windows, if you type "targetinstaller" and choose "Internet", you should able to install the LEGO NXT support.

Comment only
29 Oct 2013 Johanna

I am trying to install this support package but when I point Matlab targetinstaller to the extracted file it gives me the error message "Lego Mindstorm\lego does not contain a valid support package.
Please specify a folder that contains a valid support package and try again." I am using MATLAB 2012a, can anyone say what I am doing wrong?

Comment only
18 Aug 2013 federica

I am sorry but The automatic installation on my computer cannot install the Cygwin and i don't understand why. I've Matlab 2012a on a Macbook with OS Windows 8. Can you help me?

Comment only
19 Jan 2013 Jen-Yu Hsiao

Sorry, Can I accurately control the motor angle every sampling time by this?

Comment only
10 Jun 2012 daniel

daniel (view profile)


23 May 2012 moamoa

moamoa (view profile)


Comment only
04 May 2012 ncsu

ncsu (view profile)

04 May 2012 sshield01

great product!

Comment only
09 Apr 2012 Gautam Vallabha

Fausto, I replied to your question at

Comment only
09 Apr 2012 sshield01

The targetinstaller script was very easy to use, it automatically installed all the required support packages in about half hour on my 32-bit windows 7 box. After installation, I could successfully play with the Mindstorms demos via USB. I didn't try bluetooth yet.Since I borrowed Mindstorms NTX from a friend, I didn't have the original Lego mindstorms NTX software installed on my PC.

Comment only
06 Apr 2012 Fausto

Fausto (view profile)

I am sorry. The automatic installation on my computer cannot install the GNU ARM compiler. The message says that it is corrupt. I download manually and it shows that the file is corrupt too. There is a newer version of GNU ARM compiler that works. Please help me. I do not know haow to do the installation manually.

Comment only
30 Mar 2012 MathWorks Simulink Team

General guidelines:
* Please use this FileExchange page to post general comments and ratings on the support package

* If you have questions about using this support package, post your question at (with tag "lego", and product "simulink")

* If you have an enhancement request or wish to report a possible bug, contact MathWorks Technical Support at

Comment only
09 Apr 2012 1.1

Updated license addendum

29 May 2012 1.3

Updated URLs for 7zip and nxtOSEK

12 Sep 2012 1.4

Updated title and description to emphasize that this entry is for R2012a support

20 Feb 2013 1.5

-updated third party software dependence

11 Apr 2013 1.7

Updated third party software dependence (GNUARM)

29 Aug 2013 1.8

Update to version 1.1: Fixes Cygwin issue.

17 Sep 2013 1.9

Minor license update

17 Sep 2013 1.10

Minor license update

03 Oct 2013 1.11

Update to address Cygwin download issue.
Updated image.

06 Dec 2013 1.12

* Update to v1.3 to reduce dependencies including Cygwin

18 Sep 2014 1.13

update link

04 Aug 2015 1.14

Update includes fix for USB driver

Contact us