필터 지우기
필터 지우기

Array Access in Symbolic Calculations

조회 수: 1 (최근 30일)
Nicholas Dinsmore
Nicholas Dinsmore 2013년 3월 8일
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