Symbolic computation
6 Ansichten (letzte 30 Tage)
Ältere Kommentare anzeigen
Could you tell me how to define a array containing more than hundred symbolic variable using loop or commands?
0 Kommentare
Akzeptierte Antwort
Andrei Bobrov
am 10 Jan. 2012
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 Kommentare
Weitere Antworten (0)
Siehe auch
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!