MATLAB: Strcat and bracket and sym

bracket

Hi,
code
UserData.matrix(1,1)=num2cell(sym(strcat('x','yz')))
is OK. But for code
UserData.matrix(1,1)=num2cell(sym(strcat('x','(','yz')))
I get error
Error using ==> sym.sym>convertExpression at 2547
Error: ')' expected [line 1, col 5].
Can you help me please?
Thanks

Best Answer

The error message is clear: The closing parenthesis is missing:
strcat('x','(','yz')
% 'x(yz'
Perhaps you need:
strcat('x', '(', 'yz', ')')
But it would be simpler to omit the strcat are insert 'x(yz)' directly.