Creating an empty sym variable?

Hello,
How I can create an empty 0x0 sym variable? Such as x=[] x={}, expect I want to make x an empyt sym, not an empty double or cell.
Thank you, Kevin

 채택된 답변

Azzi Abdelmalek
Azzi Abdelmalek 2013년 2월 15일

0 개 추천

x=sym([])

댓글 수: 3

Kevin Bachovchin
Kevin Bachovchin 2013년 2월 15일
That does create the variable but it doesn't do what I want. If I have the following code
syms y x = sym([]); Sum = x+y
makes Sum an empty sym as well. I want Sum to just be y, if x is empty. Is there a way to define x in order to do that?
Even with double
x=[];
y=10
a=y+x % is different from y, it gives []
a=[x y], % gives y
Now with sym
x=sym([])
syms y
a=x+y, % the result is x
a=[x y] % the result is y
Maybe your are looking for
x=sym('0')

댓글을 달려면 로그인하십시오.

추가 답변 (0개)

카테고리

태그

Community Treasure Hunt

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

Start Hunting!

Translated by