Converting a dynamically sized mxArray to struct in Matlab Simulink -
i have extrinsic function returns mxarray
through webread()
. mxarray
should struct, can access , read data in it. problem has dynamic size, can't define it's size statically.
this code:
function out = getdatafromcloud() coder.extrinsic('webread'); coder.extrinsic('weboptions'); url = 'theurl'; options = weboptions('contenttype','json'); data_conv = webread(url); disp(data_conv(1:1).code); %at point fails, because '.code' not %possible mxarray
i'm quite new matlab please gracious. thank every answer can give!
edit1
i created dummy data, can test problem yourself. dummy data link. explanation: in dummy data, amount of category_0
3, there's code
, subcat_0
, subcat_1
. within those, there variables static, variables hold dynamically filled arrays.
the code above enables needed reproduce error. use getdatafromcloud()
in matlab simulink model this.
what necessary well, change 'theurl'
url provided. code doesn't need changing , should reproduce problem. if not, write comment.
edit2
by now, i've figured out way of wanted matlab s-function. if you're interested, created repo it. question still stands though, i'd love hear answer it.
Comments
Post a Comment