• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

MATLAB \' : \' 官方解释

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

1.冒号的作用

   产生矢量,阵列标注以及for-loop迭代子

2.描述

    冒号是MATLAB中最有用的操作符之一。它使用下述规则来创建有规则的空间矢量:

j:k

is the same as [j,j+1,...,k], or empty when j > k.

j:i:k

is the same as [j,j+i,j+2i, ...,j+m*i], where m = fix((k-j)/i), for integer values. For information on the definition of j:i:k with floating-point values, see Technical Solution 1-4FLI96. This syntax returns an empty matrix when i == 0i > 0 and j > k, or i < 0 and j < k.

    如果你指定单标量阵列,MATLAB将j:i:k 解释为 j(1):i(1):k(1).

    You can use the colon to create a vector of indices to select rows, columns, or elements of arrays, where:

A(:,j)

is the jth column of A.

A(i,:)

is the ith row of A.

A(:,:)

is the equivalent two-dimensional array. For matrices this is the same as A.

A(:,j:k)

is A(:,j), A(:,j+1),...,A(:,k).

A(:,:,k)

is the kth page of three-dimensional array A.

A(i,j,k,:)

is a vector in four-dimensional array A. The vector includes A(i,j,k,1)A(i,j,k,2)A(i,j,k,3), and so on.

A(:)

is all the elements of A, regarded as a single column. On the left side of an assignment statement,A(:) fills A, preserving its shape from before. In this case, the right side must contain the same number of elements as A.

注:上述内容来自于MATLAB帮助文档


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
【Rust】通道发布时间:2022-07-18
下一篇:
Rust交叉编译Mac编译Linux/Windows平台发布时间:2022-07-18
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap