I try to write a code in modelica. I calculate a value for 4 different areas, which are cpm_links for[1:3], cpm_oben[4:6] for, cpm_rechts for[7:9] , cpm_oben for[10:12]. Then I want to store these 4 values in a one variable which is cpm for[1:12]. How should I write a code so that all these 4 variables will be stored in cpm?
cpm_links[1:n_Kapazitaten]=cp_Kunststoff*m_link[1:n_Kapazitaten];
cpm_oben[1:n_Kapazitaten]=cp_Kunststoff*m_oben[1:n_Kapazitaten];
cpm_rechts[1:n_Kapazitaten]=cp_Kunststoff*m_link[1:n_Kapazitaten];
cpm_unten[1:n_Kapazitaten]=cp_Kunststoff*m_oben[1:n_Kapazitaten];
Use the cat
function to combine multiple arrays into one. See recent Stack Overflow question How to insert arguments of a vector inside another vector?