convert variables from string to integers
15 次查看(过去 30 天)
显示 更早的评论
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 =
[]
0 个评论
采纳的回答
Star Strider
2020-3-20
The assignment probably wants you to turn them into unsigned integers.
I leave the rest to you.
0 个评论
更多回答(0 个)
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Data Type Conversion 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!