MATLAB Answers

0

How to save a m-file on the lego ev3 brick?

Asked by Philipp Rau on 13 Nov 2015
Latest activity Commented on by Walter Roberson
on 19 Nov 2015
Hello, I need to know how i can save an matlab m-file on a lego ev3 brick using an usb-connection. I didn't found anything on google. I would like to select the saved program on the brick and run it with the buttons. But how to get it there? At the moment i am just able to run the programm while the brick ist connected with the usb-cable. please help me :) Thanks

  0 Comments

Sign in to comment.

1 Answer

Answer by Walter Roberson
on 13 Nov 2015

You could possibly transfer the source to the ev3, but none of that series can execute MATLAB m files. The process of using an ev3 involves generating code that the ev3 can use, and that code is not m files at all.

  2 Comments

so then please tell me HOW can i program in matlab (not simulink) and then transfer to the ev3? I havn't even a clue how to access the ev3 for saving a file. I just can run my m-file while connected, and thats really not useful.
Looking around a bit, it appears that you can ssh to the ev3. It appears to require the username root and the password is empty (not the word "empty", just press return at the password prompt). If this is the case then you can also scp() files on to the EV3 and then ssh in and start them executing.
The EV3 can be programmed in a number of different programming languages. I do not know which one Simulink uses, but it probably uses C or C++ together with a cross-compiler for the ARM processor.
If you want to convert MATLAB code into something that would run on the EV3, the simplest way would be to include it in a MATLAB Function Block in Simulink and use Simulink to generate and run the model. But otherwise you are going to need to use MATLAB Coder and a cross-compiler. MATLAB Coder is not available for Student Version licenses.
There might be some other method that I have missed.

Sign in to comment.