MATLAB: How to apply operations to a symbolic array

symbolic

Hi all,
I am preparing a program for symbolic Geometric Algebra computation and I am facing a problem that requires your help. My vectors will be represented in matrix form and there are many operations that need to be performed.
For example when matrix A is a double array:
A=[1 2 0; 4 0 6];
A>0
returns a logical matrix
[1 1 0;1 0 1]
However, when I set the following symbolic matrix:
syms C
a=sym(A);
a(1)=C;
a=[ C, 2, 0]
[ 4, 0, 6]
How do I apply an operation to this symbolic matrix to return the following logical matrix?
[1 1 0;1 0 1]
Thank you for your help.

Best Answer

Use the isAlways function:
syms C
A = sym([1 2 0; 4 0 6]);
L = isAlways(A > 0)
L =
2×3 logical array
1 1 0
1 0 1
However:
syms C
A = sym([1 2 0; 4 0 6]);
A(1,1) = C;
L = isAlways(A > 0)
produces:
Warning: Unable to prove '0 < C'.
> In symengine
In sym/isAlways (line 38)
In Elipses (line 79024)
L =
2×3 logical array
0 1 0
1 0 1
while setting a condition on ‘C’ produces:
syms C
assume(C, 'positive')
A = sym([1 2 0; 4 0 6]);
A(1,1) = C;
L = isAlways(A > 0)
L =
2×3 logical array
1 1 0
1 0 1