convert variables from string to integers

조회 수: 7 (최근 30일)
Zeus
Zeus 2020년 3월 19일
답변: Star Strider 2020년 3월 20일
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일
The assignment probably wants you to turn them into unsigned integers.
I leave the rest to you.

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Data Type Conversion에 대해 자세히 알아보기

태그

제품


릴리스

R2019b

Community Treasure Hunt

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

Start Hunting!

Translated by