Matrix names within a matrix

So I have a piece of code that generates many matrices: mass, time, gravity, frontal_area etc.. I would like to create a matrix A = [mass; frontal_area] which only contains specific variables. Now if I wanted the value of mass I would type A(1,1) or something to that effect. HELP

回答 (1 件)

Azzi Abdelmalek
Azzi Abdelmalek 2014 年 1 月 10 日

0 投票

mass=[1 2;3 4]
front_area=[45 6 77]
A={mass;front_area}
Then type
A{1}
A{2}

この質問は閉じられています。

タグ

質問済み:

2014 年 1 月 10 日

閉鎖済み:

2021 年 8 月 20 日

Community Treasure Hunt

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

Start Hunting!

Translated by