Include 2 libraries in matlab

Hello I am working on a project and I need to include SPI library and I2C library. is there any way I can include both? Thank you

In Matlab? No. They are Arduino libraries!

a = arduino('com22', 'uno', 'Libraries', 'SPI');

This is the syntax for spi and

a = arduino('com22', 'uno', 'Libraries', 'I2C');

But i want them together, on one arduino is it possible?
Thank you

That is invoking a matlab library. It has nothing to do with the SPI or I2C libraries on the Arduino. Those statements have NOTHING to do with what is on the Arduino.

You need to ask on a MatLab forum.

It seems to me rather unlikely that Matlab would use either of those libraries because both of them depend on access to hardware that exists on an Arduino but not on a PC.

Assuming you have an Arduino program that you want to work in conjunction with Matlab on your PC then please post the Arduino code so we can understand your problem. And please post your program using the code button </> so it looks like this

…R

This works, for those who will have same problem :slight_smile:

a = arduino(com, 'due', 'Libraries', {'I2C','SPI'});