Entering data into cell array

2 ビュー (過去 30 日間)
Dobs
Dobs 2021 年 11 月 30 日
コメント済み: Matt J 2021 年 11 月 30 日
Hi,
how do you enter data into a cell array?
I have the following empty array:
noble_gases = cell(5,4,1)
noble_gases = 5×4 cell array
{0×0 double} {0×0 double} {0×0 double} {0×0 double} {0×0 double} {0×0 double} {0×0 double} {0×0 double} {0×0 double} {0×0 double} {0×0 double} {0×0 double} {0×0 double} {0×0 double} {0×0 double} {0×0 double} {0×0 double} {0×0 double} {0×0 double} {0×0 double}
Into the left column I want to enter the names of the noble gases. In the second column the symbol, the third column the atomic mass etc.
How do I enter the data so that it is in its specific place?
Many thanks,
Dobs

回答 (1 件)

Matt J
Matt J 2021 年 11 月 30 日
noble_gases{1,1}="Hydrogen";
noble_gases{1,2}="H";
etc...
  2 件のコメント
Dobs
Dobs 2021 年 11 月 30 日
So there isn't a faster way of doing it?
Matt J
Matt J 2021 年 11 月 30 日
It depends what you are given. Do you already have the data organized in a different form?

サインインしてコメントする。

カテゴリ

Help Center および File ExchangeData Types についてさらに検索

製品


リリース

R2021b

Community Treasure Hunt

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

Start Hunting!

Translated by