Create a range of values ​​of the desired length

조회 수: 2 (최근 30일)
Lev Mihailov
Lev Mihailov 2022년 6월 15일
답변: KSSV 2022년 6월 15일
There is a range of values ​​from 16 to 42, I need to get 8 values ​​in an equal interval. Is there a function in matlab for this?
x=42-16;
y=x/8;
z=16:y:42;
Thanks in advance

채택된 답변

KSSV
KSSV 2022년 6월 15일
iwant = linspace(16,42,8)
iwant = 1×8
16.0000 19.7143 23.4286 27.1429 30.8571 34.5714 38.2857 42.0000

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Get Started with MATLAB에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by