readRegister function undefined when used in GUIDE
Ältere Kommentare anzeigen
Hi All,
I'm a hobbyist attempting to create a basic gui that will sample data from an I2C based current sensor that is attached to my raspberry pi. I have written and successfully tested a class that correctly samples this data when run via a standard Matlab Script. However, when I attempt to code this into a gui, I get the following error message when I try to call the readRegister function:
Undefined function 'readRegister' for input arguments of type 'double'.
From doing research, I believe that matlab somehow cannot locate the readRegister function when called from the gui. This confuses me since the function easily runs if I simply call it from the command line, for example this works outside of the gui:
config_values = readRegister(sensor.i2cLink,register_address,'uint8',2);
where sensor.i2cLink and register_address are specifically defined (and verified to exist when debugging).
Does anyone know of a work around to this?
Akzeptierte Antwort
Weitere Antworten (0)
Kategorien
Mehr zu Run on Target Hardware finden Sie in Hilfe-Center und File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!