1
$\begingroup$

I want to program an arduino using matlab by "arduino support package" and I want to use simulink in normal input output operations but also use Matlab language in another part so is it possible to make a code consist of simulink model and matlab language and add this code to arduino ? and if it possible how to make it ?

$\endgroup$
2
$\begingroup$

You can use from simulink library browser under User-defined functions figure out which one is suitable for your system.

If you get some delay while calling Matlab function than you can also use a sybsytem as matlab function because matlab function gives output in delay in terms of calling function and returning the value but if you generate the same function im simulink model then output will be without delayed version as shown in the figure

$\endgroup$
  • 1
    $\begingroup$ Welcome to Robotics Krunal Vaghani, but on Stack Exchange we are are looking for comprehensive answers that provide some explanation and context. Very short answers cannot do this, so you may want to edit your answer to explain why it is right, ideally with citations. Answers which don't include explanations may be removed if brought to a moderators attention. $\endgroup$ – Mark Booth Oct 17 '16 at 15:57
  • $\begingroup$ @MarkBooth thank you for suggestion. I will try my best to explain the answer. $\endgroup$ – kruxx Nov 1 '16 at 10:50
1
$\begingroup$

You can run a reduced version of the matlab language in Simulink using the Matlab function block, but I doubt this includes arduino commands.

You can extend this reduced version of the Matlab language by declaring the external functions which you would like to use, with the coder.extrinsic command. here is a tutorial on how to do this.

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.