add set and get functions for data transfer.
add conversion to matlab