haibaraxx的个人博客分享 http://blog.sciencenet.cn/u/haibaraxx

博文

Matlab: the colon operator :

已有 2284 次阅读 2016-8-22 22:40 |个人分类:Matlab|系统分类:科研笔记| The, colon, operator

Syntax: x=1:3:9; % colon (:) returns a vector that starts at 1 with an increment of 3, and stops no higher than 9.

Output: [1 4 7]


Syntax: y=10:-2:3;

Output: [10 8 6 4]

!!WRONG Syntax: y=10:2:3;


Syntax: z=1:5;

   或者  z=colon(1,5);

Output: [1 2 3 4 5]



https://wap.sciencenet.cn/blog-3031432-998046.html

上一篇:Matlab: size and length of an array
下一篇:Matlab: precedence
收藏 IP: 134.1.1.*| 热度|

0

该博文允许注册用户评论 请点击登录 评论 (0 个评论)

数据加载中...

Archiver|手机版|科学网 ( 京ICP备07017567号-12 )

GMT+8, 2024-6-1 14:03

Powered by ScienceNet.cn

Copyright © 2007- 中国科学报社

返回顶部