Due wire library issues in Matlab Simulink

I have been struggling with this, and can’t seem to figure out the issue. :confused: I’m posting it here rather than the Matlab forum because I think this is more of an issue with the Arduino library. I am trying to write a code in Matlab Simulink that requires the Wire library. I moved the Wire.h and Wire.cpp files to my working folder but I keep getting this error message:

In file included from C:/Users/slb0494/Desktop/LCD/SparkFun_MAG3110.h:24:0, 
                 from ../Mag_wrapper.cpp:20: 
C:/Users/slb0494/Desktop/LCD/Wire.h:25:25: fatal error: include/twi.h: No such file or directory 
 #include <include/twi.h> 
                         ^ 
compilation terminated. 
gmake: *** [Mag_wrapper.o] Error 1

The board I am using is the Due, and I am using the Due library. Unfortunately I have to create an S-function with the Wire library rather than use the I2C communication blocks from the Arduino support package because I need to communicate with multiple sensors of the same address through an I2C multiplexer. I’ve been looking at other examples of S-functions with the wire library and they all seem to be following the same procedure without issue. I also have another S-function in my model that uses a different library and works fine. Any help would be appreciated!

I moved the Wire.h and Wire.cpp files to my working folde

But, you apparently did not move the include folder at the same time. You need to.

PaulS: But, you apparently did not move the include folder at the same time. You need to.

If you're referring to the twi.h, I'm not sure where to find that.

If you're referring to the twi.h, I'm not sure where to find that.

The folder that used to contain Wire.cpp and Wire.h also contained a folder named include that contains twi.h. You need to copy EVERYTHING that was in the Wire.cpp folder.

PaulS: The folder that used to contain Wire.cpp and Wire.h also contained a folder named include that contains twi.h. You need to copy EVERYTHING that was in the Wire.cpp folder.

I copied over the entire Wire folder, but am still am having the same issue. I also didn't see any other source and header files in that folder other than wire.cpp and wire.h. Is there maybe another location of these files? I found the wire library by opening the file location of one of the example sketches for the Due in the Arduino IDE.