how can i store all simulation results from gibbs sampling ?

조회 수: 3 (최근 30일)
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 CenterFile Exchange에서 Specialized Power Systems에 대해 자세히 알아보기

태그

아직 태그를 입력하지 않았습니다.

Community Treasure Hunt

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

Start Hunting!

Translated by