I would like to get 3 subranges of equal interval from the given range a=0.0035(min) b=0.11935(max) And also I would like to get midpoint of each subranges. Please let me know how to do this
Thanks

 採用された回答

Adam Danz
Adam Danz 2018 年 7 月 24 日
編集済み: Adam Danz 2018 年 7 月 24 日

0 投票

The star of this show is linspace(). This assumes the start of segment #2 is the end of segment #1 and so on. Once you have the start and stop points and each segment has the same length, you just need to subtract half of the length from each end point to get the middle points.
a=0.0035
b=0.11935
nSegments = 3;
endPoints = linspace(a,b,nSegments + 1); %4 endpoints for 3 segments
start = endPoints(1:end-1); %3 starting points
stop = endPoints(2:end); %3 stopping points
midPoints = stop - ((stop(1)-start(1))/2); %3 middle points

その他の回答 (0 件)

カテゴリ

ヘルプ センター および File ExchangeRead, Write, and Modify Image についてさらに検索

タグ

質問済み:

2018 年 7 月 24 日

コメント済み:

2018 年 7 月 24 日

Community Treasure Hunt

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

Start Hunting!

Translated by