how to get a part of a number

4 次查看(过去 30 天)
matthieu
matthieu 2022-10-8
回答: Voss 2022-10-8
x = 1234567891011112
The output should be 56

回答(1 个)

Voss
Voss 2022-10-8
x = 1234567891011112;
x_str = num2str(x)
x_str = '1234567891011112'
x_str = x_str([5 6])
x_str = '56'
str2double(x_str)
ans = 56

类别

Help CenterFile Exchange 中查找有关 Simulink Environment Customization 的更多信息

标签

产品


版本

R2022b

Community Treasure Hunt

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

Start Hunting!

Translated by