Array Access in Symbolic Calculations

1 次查看(过去 30 天)
I am using the symbolic math toolbox to turn an ugly recursive algorithm that accesses and array into a matlab function. Everything is working but I keep getting a warning message that makes me think I am declaring the array as a function which I think is a bit hacky. I am hoping someone can point me to a better method.
Here is how I am doing it:
i=sym('i');
assume(i,'integer');
ArrayVar= symfun(sym('ArrayVar(i)'), [i]);
...%inset recursive Algorithm here
matlabFunction(RecursiveResult,'file','FlattenedAlgorithm.m','vars',{'index','ArrayVar'});
Like I said that works but when I run it I get a warning message that I am hoping with better representation of the array I could avoid. The warning message is "Warning: Function "ArrayVar" is not verified to be a valid MATLAB function.". I could just suppress the message but before I do that I wanted to make sure there wasn't a better way to access the array without pretending it is a function.

回答(0 个)

类别

Help CenterFile Exchange 中查找有关 Symbolic Math Toolbox 的更多信息

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by