What is the meaning of ":"?

46 visualizzazioni (ultimi 30 giorni)
Chew
Chew il 6 Lug 2020
Commentato: Steven Lord il 7 Lug 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

Risposta accettata

madhan ravi
madhan ravi il 6 Lug 2020
doc colon
  3 Commenti
Chew
Chew il 7 Lug 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 il 7 Lug 2020
It's a call to the min function the output of which is subtracted from element (i, j) of the array a.

Accedi per commentare.

Più risposte (0)

Community Treasure Hunt

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

Start Hunting!

Translated by