Borrar filtros
Borrar filtros

Array Access in Symbolic Calculations

1 visualización (últimos 30 días)
Nicholas Dinsmore
Nicholas Dinsmore el 8 de Mzo. de 2013
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.

Respuestas (0)

Categorías

Más información sobre Symbolic Math Toolbox en Help Center y File Exchange.

Community Treasure Hunt

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

Start Hunting!

Translated by