-1

I want to design a system that has to read some values from sensors through Arduino microcontroller using Matlab.

I want to use the simulink inputs as the sensors and the output to the motors, I wrote an app to do that on Arduino, and also I wrote some functions in Matlab to read these sensors and to control the output, but I want to use simulink to implement a Fuzzy logic Controller the input is the values of sensors and the output is the speed.

1 Answers1

1

If you wrote the functions for MATLAB in C, you can put your code in an S-Function, whether it is for sensor input or actuator output.

Otherwise, either use Embedded M file or S-function in your Simulink model.

Makketronix
  • 1,389
  • 1
  • 11
  • 31
  • Thank you, I found a good method to do that, just make all inputs and output from workspace to the simulink global variables, and run the command sim('SimulinkName') it will work 100%. – user3450832 Mar 27 '14 at 19:42