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 =
[]

 Respuesta aceptada

Star Strider
Star Strider el 20 de Mzo. de 2020

0 votos

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

Más respuestas (0)

Categorías

Más información sobre Data Type Conversion en Centro de ayuda y File Exchange.

Productos

Versión

R2019b

Etiquetas

Preguntada:

el 19 de Mzo. de 2020

Respondida:

el 20 de Mzo. de 2020

Community Treasure Hunt

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

Start Hunting!

Translated by