필터 지우기
필터 지우기

help with structuring variables

조회 수: 1 (최근 30일)
sri satya ravi
sri satya ravi 2017년 2월 22일
댓글: sri satya ravi 2017년 2월 22일
hi;
I have 10 variables or so and want to create a structure at the end of my code for those variables. I tried this s = struct ('continous_emissions',[final_m_co2_g_sec,final_m_co_g_sec, final_m_thc_g_sec, final_m_no_g_sec, final_m_no2_g_sec, final_m_nox_g_sec]); but i get one structure with all length 1200*6. I want to have them as continous_emissions.final_m_co2_g_sec,continous_emissions.final_m_co_g_sec and so all.....not all in one.
Any ideas??

채택된 답변

James Tursa
James Tursa 2017년 2월 22일
Like this?
continous_emissions = struct('final_m_co2_g_sec',final_m_co2_g_sec,...
'final_m_co_g_sec',final_m_co_g_sec,...
etc);
  댓글 수: 1
sri satya ravi
sri satya ravi 2017년 2월 22일
Yes that works.....
Thanks!!

댓글을 달려면 로그인하십시오.

추가 답변 (0개)

카테고리

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

태그

Community Treasure Hunt

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

Start Hunting!

Translated by