Filter löschen
Filter löschen

how can i store all simulation results from gibbs sampling ?

2 Ansichten (letzte 30 Tage)
for example : for i=1:3 b=n*ones(3) end the result will be [3 3 3;3 3 3;3 3 3] BUT i want to save the hole result as [1 1 1;1 1 1;1 1 1;2 2 2;2 2 2;2 2 2;3 3 3;3 3 3;3 3 3] How can i do it????

Akzeptierte Antwort

Muruganandham Subramanian
Muruganandham Subramanian am 29 Nov. 2012
Check this:
for i=1:3
a{i}=i*ones(3);
end
b=cell2mat(a)
  2 Kommentare
arkedia
arkedia am 2 Dez. 2012
thanks for the answer , but the result will be [111222333;111222333;111222333] and the result i want is to be horizontal as [111;111;111;222;222;222;333;333;333] is it possible??
Muruganandham Subramanian
Muruganandham Subramanian am 6 Dez. 2012
try this:
for i=1:3
a{i}=i*ones(3);
d(:,:,i)=a{i};
end

Melden Sie sich an, um zu kommentieren.

Weitere Antworten (0)

Kategorien

Mehr zu Modeling finden Sie in Help Center und File Exchange

Tags

Noch keine Tags eingegeben.

Community Treasure Hunt

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

Start Hunting!

Translated by