冒号的使用

img1 = img1(1:f:end,1:f:end);我认为是分别从行列两个方向,分别是从1到最后,然后步长是f的慢慢移动。

我是遇到这个问题才查的冒号问题,知道这个是使图像尺寸减小。

在这个链接里面可以看出来https://blog.csdn.net/kungChang/article/details/51669677

https://blog.csdn.net/zhangliaobet/article/details/80712165

下面是在MATLAB中help查到的冒号的用法。

Using the colon with integers,

D = 1:4
results in

D =
    1    2    3    4
Using two colons to create a vector with arbitrary real increments between the elements,

E = 0:.1:.5
results in

E =
    0    0.1000    0.2000    0.3000    0.4000    0.5000
The command

A(:,:,2) = pascal(3)
generates a three-dimensional array whose first page is all zeros.

A(:,:,1) =
     0     0     0
     0     0     0
     0     0     0

A(:,:,2) =
     1     1     1
     1     2     3
     1     3     6
Using a colon with characters to iterate a for-loop,

for x='a':'d',x,end
results in

x = 
    a
x = 
    b
x = 
    c
x = 
    d

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值