필터 지우기
필터 지우기

Creating a table with repeating values

조회 수: 15 (최근 30일)
Orongo
Orongo 2019년 2월 19일
답변: Akira Agata 2019년 2월 19일
Hi, I want to store my simulated values into a table with the headings; Simulation, Gender, Age and Year and m_xt. I have done 10,000 simulations (the number of simulation will be in heading Simulation, hence 1 for simulation 1, 2 for simulation 2 and so on) and my m_xt are the simulated values. The variable Year are the years 1996, 1997, ..., 2014. The variable m_xt is a cell of 1x10000 cell where each cell is a 101x19 double. I have written following
Table_m_xt=table(...
'Simulation', ones(101,1),...
'Gender','Male', ...
'Age', (0:1:100)', ...
'Year',repmat(1996,101,1), ...
'm_xt',m_female{1,1}(:,1));
but get the error message
Invalid parameter name: Simulation.
Not seeing what is going wrong here, what is needed to be changed?

답변 (1개)

Akira Agata
Akira Agata 2019년 2월 19일
If the size of your variable m_female{1,1}(:,1) is 101-by-1, the following should work.
Table_m_xt = table(...
ones(101,1),repmat('Male',101,1),(0:1:100)',repmat(1996,101,1),m_female{1,1}(:,1),...
'VariableNames',{'Simulation','Gender','Age','Year','m_xt'});

카테고리

Help CenterFile Exchange에서 Simulink에 대해 자세히 알아보기

태그

제품

Community Treasure Hunt

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

Start Hunting!

Translated by