What is the meaning of ":"?

7 views (last 30 days)
Chew
Chew on 6 Jul 2020
Commented: Steven Lord on 7 Jul 2020
HI, this is part of the code that I'm studying about. But I do not quite understand what does each line mean.
Can I ask what does ":" mean?
for example 1:m and -xw:xw
function f=asmf(x)
[m n]=size(x);
a=x;
fl(1:m,1:n)=1;
mw=5;
for i=1:m
for j=1:n
cond=1;
xw=1;
while(cond==1)
co=0;
for k=-xw:xw
for l=-xw:xw

Accepted Answer

madhan ravi
madhan ravi on 6 Jul 2020
  3 Comments
Chew
Chew on 7 Jul 2020
also, I do not understand this line. what does "-min" mean?
if (co>0)
if (abs(a(i,j)-min(s))<td)&&(abs(a(i,j)-max(s))<td)
f(i,j)=a(i,j);
else
f(i,j)=median(s);
end
Steven Lord
Steven Lord on 7 Jul 2020
It's a call to the min function the output of which is subtracted from element (i, j) of the array a.

Sign in to comment.

More Answers (0)

Community Treasure Hunt

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

Start Hunting!