필터 지우기
필터 지우기

Defining/Checking assumptions on symoblic arrays

조회 수: 2 (최근 30일)
Joseph
Joseph 2012년 6월 5일
Hi all,
I have been encountering a problem/inconsistency while using Matlab 2011b for defining and checking symbolic variable assumptions.
Even the example from the help file does not properly identify the assumptions on the following variable:
A = sym('A%d%d', [2 2]);
A = sym(A, 'positive');
evalin(symengine,'getprop(A(1,1))')
ans =
C_
evalin(symengine,'getprop(A)')
ans =
C_
However, it actually does obey the assumptions, atleast for this example from the help. (below)
solve(A(1, 1)^2 - 1, A(1, 1))
ans =
1
This problem does not happen for scalar variables, that does work properly.
Is there a way to check the assumptions on a whole array/matrix or even the different elements that comprise the array/matrix? Given the two checks on properties above it does not seem so.
Might it be a problem that needs me switching to the newest version (2012); however I am hesitant to do this because last time I found errors with 2010 symbolic and compiler toolboxes, upon upgrading to 2011 I found that the subs() has changed functionality and would no longer substitute vectors properly (this problem has been referenced by others in the Matlab Answers).
Thanks for any help that can be provided, Joe

답변 (1개)

Christopher Creutzig
Christopher Creutzig 2012년 6월 27일
The name inside MuPAD is not A(1,1). Try this instead:
A = sym('A%d%d', [2 2]);
A = sym(A, 'positive');
feval(symengine, 'getprop', A(1,1))
ans =
Dom::Interval(0, Inf)
I'm not sure I know which problem with subs and vectors you refer to. I know of one issue that was fixed in 2012a.

카테고리

Help CenterFile Exchange에서 Properties and Assumptions에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by