how can i store all simulation results from gibbs sampling ?

1 回表示 (過去 30 日間)
arkedia
arkedia 2012 年 11 月 29 日
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????

採用された回答

Muruganandham Subramanian
Muruganandham Subramanian 2012 年 11 月 29 日
Check this:
for i=1:3
a{i}=i*ones(3);
end
b=cell2mat(a)
  2 件のコメント
arkedia
arkedia 2012 年 12 月 2 日
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 2012 年 12 月 6 日
try this:
for i=1:3
a{i}=i*ones(3);
d(:,:,i)=a{i};
end

サインインしてコメントする。

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeProgramming についてさらに検索

タグ

タグが未入力です。

Community Treasure Hunt

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

Start Hunting!

Translated by