|||
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]
Archiver|手机版|科学网 ( 京ICP备07017567号-12 )
GMT+8, 2024-6-1 14:03
Powered by ScienceNet.cn
Copyright © 2007- 中国科学报社