Hello,
I am bit stuck here. I try to use the matlab function "ppval" in an embedded matlab function block in Simulink, but this is obviously not working, since it is not officially supported in the embedded matlab function library.
Therefore I tried different things.
1. copying the code, which underlies the ppval.m, into the embedded matlab function file might be a way and using it as a function (e.g. name it ppval_int()). The same way with the function unmkpp(), as it is not officially eml-compatible. I just copied the code from unmkpp.m into my original function file as another function.
The only obstacle is to make this code being compatible for using in an embedded matlab environment. trying this as a first shot fails due to the statement (and others)
if length(sizexx)==2&&sizexx(1)==1, sizexx(1) = []; end
--> error: "Removing elements from a matrix is not supported."
Might this even though be a practicable way of implementing ppval into an embedded matlab (eml) environment? Or is making this function eml-compatible hopeless?
2. using a c-coded function ppval (e.g. name it ppvalmex) (from here:
http://octave.1599824.n4.nabble.com/ppval-td1674970.html) to have compiled a ppvalmex.mexw32 and hence I referenced this using ppvalmex() instead of ppval() or ppval_int()). But this didn't work for the reason, that "Embedded MATLAB can only compile MATLAB files; unsupported file extension 'mexw32'"
--> is there maybe a way to make use of the ppvalmex.c, as in the above source, for using it in an eml-environment? or would i necessarily need to recode this without any mxArrays but with sfunction compatibility into an sfunction block?
My questions:
a) which of those two options is in your opinion the most promising option? or might there be another better option I didn't think of yet? how could I work around my previously found obstacles?
b) is there somewhere an eml-compatible implementation of ppval, which I could easily use?
c) does building a ppval-sfunction-block even make sense, since I call the ppval-function for about 10 times in my eml-function-block?
d) consider the fact I'd have a working sfunction-ppval-block. Is there actually a possibility to transfer the pp-structures through the block-gates in Simulink?
I would really appreciate your help.
Thanks,
trabbie