Strcat and bracket and sym

2 次查看(过去 30 天)
john
john 2013-2-20
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

采纳的回答

Jan
Jan 2013-2-20
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.
  1 个评论
john
john 2013-2-20
I was thinking, that one char '(' is enough. Hmmmm. OK.
What happen if somebody will need something like that :-))) ?
But thanks a lot Jan

请先登录,再进行评论。

更多回答(0 个)

类别

Help CenterFile Exchange 中查找有关 Characters and Strings 的更多信息

标签

Community Treasure Hunt

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

Start Hunting!

Translated by