I was asked to use an excel sheet containing names, user ID's, height, weight, and age.

3 ビュー (過去 30 日間)
Hind Aljallaf
Hind Aljallaf 2021 年 11 月 23 日
コメント済み: Hind Aljallaf 2021 年 11 月 27 日
The excel sheet part is all covered, but we were also asked to display the user's ID's and BMI index. I am very lost since i don't know how to start, so can I please get some help to start?
  1 件のコメント
Hind Aljallaf
Hind Aljallaf 2021 年 11 月 23 日
What are the codes I should be focusing on in order to find those two components?


回答 (1 件)

Srijith Kasaragod
Srijith Kasaragod 2021 年 11 月 26 日
編集済み: Srijith Kasaragod 2021 年 11 月 26 日
Hi Hind,
Once the table is imported into MATLAB workspace, any table variable can be accessed using dot syntax. For example, assuming the table 'User' contains the variablename 'UserID' it can accesed using the syntax given below:
values= User.UserID; %'values' would contain the elements under variable 'UserID' as table array
Please refer this page to know more on how to compute BMI index, given height and weight of a person. Once computed, the values could be added as a variable to the table and accessed using dot syntax.
Refer this page to read more about MATLAB tables and dot syntax.
Hope this helps!

Community Treasure Hunt

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

Start Hunting!

Translated by