how to get a part of a number

2 Ansichten (letzte 30 Tage)
matthieu
matthieu am 8 Okt. 2022
Beantwortet: Voss am 8 Okt. 2022
x = 1234567891011112
The output should be 56

Antworten (1)

Voss
Voss am 8 Okt. 2022
x = 1234567891011112;
x_str = num2str(x)
x_str = '1234567891011112'
x_str = x_str([5 6])
x_str = '56'
str2double(x_str)
ans = 56

Kategorien

Mehr zu Introduction to Installation and Licensing finden Sie in Help Center und File Exchange

Tags

Produkte


Version

R2022b

Community Treasure Hunt

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

Start Hunting!

Translated by