+ Post New Thread
Results 1 to 5 of 5
  1. #1
    Junior Member level 1
    Points: 295, Level: 3

    Join Date
    Jun 2017
    Location
    Bhubaneswar, India
    Posts
    19
    Helped
    2 / 2
    Points
    295
    Level
    3

    Programming microcontroller using matlab

    Hello everyone,
    Is it possible to program microcontroller using matlab. There is an option of generating C code for the matlab code but it is not diresctly compatible with the microcontroller. arduino boards are directly programmed through the Matlab, can other microcontrollers also be programmed similarly or there limited controllers which can be done that way. Another thing is, suppose I have created a PID controller block diagram and want to generate that PID algorithm, how to do this. please help!

    thank you

    •   Alt10th May 2018, 11:08

      advertising

        
       

  2. #2
    Super Moderator
    Points: 26,514, Level: 39
    andre_teprom's Avatar
    Join Date
    Nov 2006
    Location
    Brazil
    Posts
    7,965
    Helped
    995 / 995
    Points
    26,514
    Level
    39
    Blog Entries
    5

    Re: Programming microcontroller using matlab

    As you might know, MATLAB is a tool intended to deal primarily with numerical computation, so its purpose is to make calculations for a given set of parameters. Even if the tool were able to make generating of C code outputs, there is no impediment to you embeed those function within your program by your own (being C a structured languagem you just inject values to the function argument, and get the returned result). A C compiler in other hand is a tool which not only allow standard C language, but also several specific settings, optimizations and linkages that is not the role of MATLAB. I would rather expect IDEs of microcontroller`s manufacturers providing plugin to MATLAB, instead of the opposite, anyway sounds as an unlikely feature to hope.
    --------------------------------------------------------------------------------------------------
    Part of the world that you live in, You are the part that you're giving ( Renaissance )



    •   Alt10th May 2018, 19:27

      advertising

        
       

  3. #3
    Junior Member level 1
    Points: 295, Level: 3

    Join Date
    Jun 2017
    Location
    Bhubaneswar, India
    Posts
    19
    Helped
    2 / 2
    Points
    295
    Level
    3

    Re: Programming microcontroller using matlab

    Sir, should I ask to the matlab forum for the algorithm generation or can you help me that how can i generate the C code out of the simulink model?



    •   Alt11th May 2018, 06:32

      advertising

        
       

  4. #4
    Super Moderator
    Points: 26,514, Level: 39
    andre_teprom's Avatar
    Join Date
    Nov 2006
    Location
    Brazil
    Posts
    7,965
    Helped
    995 / 995
    Points
    26,514
    Level
    39
    Blog Entries
    5

    Re: Programming microcontroller using matlab

    Your initial question was another one, and the answer given was related to it:

    Is it possible to program microcontroller using matlab
    Now, you are asking another question:

    generate the C code out of the simulink model
    And in that case from now you should wait for an answer from someone who has experience with this. Anyway, a quick search on the Web gave the answer, took few seconds from a query and we can easily find this 'official' tutorial:

    --------------------------------------------------------------------------------------------------
    Part of the world that you live in, You are the part that you're giving ( Renaissance )



  5. #5
    Newbie level 1
    Points: 15, Level: 1

    Join Date
    May 2018
    Posts
    1
    Helped
    0 / 0
    Points
    15
    Level
    1

    Re: Programming microcontroller using matlab

    I also turned to the tutorial, but it's a pretty better to start with C programming to write the program text, then I use the compilers. And if there is a compilation error, I seek the help of knowledge from more experienced

    programmers https://www.assignmentexpert.com/pro...cience-project (if to take into account the production scales and not only one particular 1 microcontroller),

    you can create, edit and digest the code written by me, achieving the optimal workflow.



--[[ ]]--