convert variables from string to integers

hi ,So im new to matlab and im trying to convert string to integers .The question is 'Convert all the numbers in the variables Oxygen, CarbonDioxide, Temperature, Pressure, SolarRadiation and Humidity from strings to integers.'
is using str2num correct?
Oxygen=str2num("Oxygen")
%and so on for the other varaibles
is this syntax correct as it produces an output(below) ?or should it contain values from the input data?
Oxygen =
[]

 採用された回答

Star Strider
Star Strider 2020 年 3 月 20 日

0 投票

The assignment probably wants you to turn them into unsigned integers.
I leave the rest to you.

その他の回答 (0 件)

カテゴリ

ヘルプ センター および File ExchangeData Type Conversion についてさらに検索

製品

リリース

R2019b

タグ

質問済み:

2020 年 3 月 19 日

回答済み:

2020 年 3 月 20 日

Community Treasure Hunt

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

Start Hunting!

Translated by