Symbolic computation

조회 수: 2 (최근 30일)
arun
arun 2012년 1월 10일
Could you tell me how to define a array containing more than hundred symbolic variable using loop or commands?

채택된 답변

Andrei Bobrov
Andrei Bobrov 2012년 1월 10일
e.g. (R2011b):
A = sym('A',[10 10])
A1 = sym('A1_',[100 1])
OR
[x y] = meshgrid(1:10);
for i1 = 1:numel(x)
A2(y(i1),x(i1)) = sym(sprintf('A2_%d_%d',y(i1),x(i1)));
end
OR
[x y] = meshgrid(1:10);
k = arrayfun(@(i1)sym(sprintf('A3_%d_%d',y(i1),x(i1))),1:numel(x),'un',0);
A3 = reshape([k{:}],10,[]);
  댓글 수: 3
arun
arun 2012년 1월 12일
thank you for your answer. Now I'm using matlab 2008.
arun
arun 2012년 1월 12일
thank you for your answer. Now I'm using matlab 2008.

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

추가 답변 (0개)

태그

Community Treasure Hunt

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

Start Hunting!

Translated by