필터 지우기
필터 지우기

create symbolic variables

조회 수: 2 (최근 30일)
Artur M. G. Lourenço
Artur M. G. Lourenço 2011년 11월 8일
My problem is the following:
if I have an array ij then have to create variables ij.
ex.:
a = [ 1 2; 3 4]
then
b = [x11 x21;x12 x22]
have to create the variables corresponding to the size of the matrix.
These variables can be syms or string. Can I convert the string to syms after.
thanks advanced
  댓글 수: 1
Artur M. G. Lourenço
Artur M. G. Lourenço 2011년 11월 8일
in fact there str2sym. Sorry

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

채택된 답변

Andrei Bobrov
Andrei Bobrov 2011년 11월 8일
a = [1 2;3 4];
x = sym('x%d%d',size(a)).'
please read: doc sym

추가 답변 (1개)

Artur M. G. Lourenço
Artur M. G. Lourenço 2011년 11월 8일
My god, I ask my five excuses. Always read the doc before asking a question and this time I have not read. Thank you, this is not repeated.
  댓글 수: 2
Walter Roberson
Walter Roberson 2011년 11월 8일
Though to be fair, this feature is new in R2011b. (Or was it R2010b?)
Artur M. G. Lourenço
Artur M. G. Lourenço 2011년 11월 11일
true

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

Community Treasure Hunt

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

Start Hunting!

Translated by