let me know whether there is any incompatibilities between MATLAB and Leonardo?
Everything a Uno can do a Leonardo can do.
QuoteEverything a Uno can do a Leonardo can do.On the other hand, the serial port must be opened using DtrEnable, to talk to the Leonardo. If MATLAB does not use that flag, it can't communicate with the Leonardo.
comport.DtrEnable = true;