|
I am writing an S function in m code. As part of mdlInitializeSizes() function I am defining certain variables as follows
function [sys,x0,str,ts]=mdlInitializeSizes()
exports = zeros(1, n_export);
p_exp = libpointer('doublePtr', exports);
...
...
When I try to extract these in mdlUpdate, I get an error "undefined function or variable 'p_exp' ".
function sys=mdlUpdate(t,x,u)
exports = get(p_exp, 'Value');
...
...
Not sure what I am missing in setting up these variables such that they are visible in all functions. Any help is appreciated.
|