Strcat and bracket and sym

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일

1 개 추천

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개)

카테고리

도움말 센터File Exchange에서 Logical에 대해 자세히 알아보기

태그

질문:

2013년 2월 20일

Community Treasure Hunt

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

Start Hunting!

Translated by