0

I know how to write code on matlab but I'm very beginner for raspberry pi 3. I want to write a code on matlab and run on raspberry pi. I wrote this code and will try on raspberry pi. I tried this code via connection raspberry pi to my matlab(laptop) and it worked. Will it work on raspberry pi without matlab?

mypi = raspi();
for k = 1:10;

   writeLED(mypi,'led0',1)
   pause(0.5)
   writeLED(mypi,'led0',0)
   pause(0.5)

 end

How can I do? Is there any special code that I must write in my code? and I need to use deploytool command

Emre Kurt
  • 13
  • 4
  • This is not duplicate question. Raspberry PI is embedded device on which computer executable will not run. For embedded device you need to generate "embedded c code" from matlab file and then compile it using your device compiler. But requried matlab libraries will not fit into PI's memory and architecture and executable will never work. Right way is to use [Raspberry Pi Package](https://in.mathworks.com/discovery/raspberry-pi-programming-matlab-simulink.html) – SACn Mar 02 '17 at 22:18
  • In deploytool I make an executable file with matlab libraries so you can run this file in another computer without matlab, it works but I need to run this on raspberry,I have raspberry and display for it, we will study on raspberry with display without any help from any computer. This is our project and our professor work on this and they accomplished, they want us to learn how to do like this so I'm trying to search on net but I couldn't find anything about it and asked here – Emre Kurt Mar 03 '17 at 12:03
  • Normal executable can't run on embedded device as it needs two things: operating system and matlab runtime. With "model to code" we can generate C code for M File with MATLAB libraries that can be compiled using compiler for particular embedded device and executed without operating system. I insist you should got through [Raspberry Pi Package](https://in.mathworks.com/discovery/raspberry-pi-programming-matlab-simulink.html). `deploytool` is easy it'll give windows executable. – SACn Mar 04 '17 at 02:52
  • I have an operating system which is rasbian and I installed it on raspy. I can display raspy with display without any help of any pc.I just want to run any program on rasp(maybe add 2 number which enter via input command or blink led on rasp).I looked what you insisted before. it's too pro for me now and it's about simulink control, Our propose is not to use matlab or simulink. just we can use matlab for making program for raspy. 'deploytool' must be used for this. Thanks in advance @SACHIN – Emre Kurt Mar 12 '17 at 17:27

0 Answers0