what does k = 0:25.5:255 function means

1 回表示 (過去 30 日間)
mohammad mehio
mohammad mehio 2021 年 10 月 18 日
コメント済み: mohammad mehio 2021 年 10 月 18 日
for k = 0:25.5:255
io = imread('MRI.png')
ig = rgb2gray(io)
subplot(1,1,1)
imshow(ig)
[r,c] = size(ig) % r=row,c=column
disp9[r,c])
  1 件のコメント
mohammad mehio
mohammad mehio 2021 年 10 月 18 日
what does k= 0:25.5:255 means

サインインしてコメントする。

採用された回答

Adam
Adam 2021 年 10 月 18 日
編集済み: Adam 2021 年 10 月 18 日
doc colon
It means create an array starting at 0, incrementing by 25.5 each time, with a maximum value of 255.
Easiest way to see these things for yourself is just do it on command line on its own and see the result. Note that if the end value is not excactly on the increment from the start point then this value will not be included. It is a maximum end point for the array rather than an specific end point.
In this case it will be included:
0:25.5:255
ans =
0 25.5000 51.0000 76.5000 102.0000 127.5000 153.0000 178.5000 204.0000 229.5000 255.0000

その他の回答 (0 件)

Community Treasure Hunt

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

Start Hunting!

Translated by