Arduino Mega to interface.

I want to measure simulated engine rpm signal with Arduino Mega and import the data in Matlab for further processing. I am using Matlab R2015a. please suggest how to I exchange data between Arduino IDE and Matlab 2015a.

please suggest how to I exchange data between Arduino IDE and Matlab 2015a.

A serial link would seem to be the most obvious but my knowledge of Matlab is limited.

Incidentally, it is not the IDE that you are communicating with, rather it is the Arduino itself.

I am measuring engine rpm and want to detect a missing tooth on the crankshaft wheel. To do this I need to use interrupt in Arduino IDE and detect presence of missing tooth always as calculate the rpm. this two calculated parameters are required to be processed in Matlab to generate the fuel pulse and ignition pulse. how does Matlab gets this info from Arduino or is there any code that I can write the Arduino interrupts in Matlab.

how does Matlab gets this info from Arduino

A serial link would seem to be the most obvious but my knowledge of Matlab is limited.

You should research the nature of the USB serial connection between the PC and the Arduino.

sunilamulye:
To do this I need to use interrupt in Arduino IDE and detect presence of missing tooth always as calculate the rpm. this two calculated parameters are required to be processed in Matlab to generate the fuel pulse and ignition pulse.

The combination of Matlab and Arduino won't be able to do this in real time if your fuel and ignition pulses are intended to control a real motor. There is far too much latency in the USB system.

This sort of thing needs to be done entirely within the Arduino with, perhaps, some occasional guidance from Matlab. (Occasional might be (say) 2 to 5 times per second).

...R