-
matlab permute函数
2017-09-26 21:23:37A=[1 3 2 2 8 7] permute(A,[1,2,3])=A permute(A,[2,1,3])=A' permute(A,[1,3,2])= [1 2]',[3 8]',[2,7]' permute(B,[3,1,2])= [1 2],[3 8],[2,7] permute(B,[2,3,1])= [1 3 2]'A=[1 3 2
2 8 7]
permute(A,[1,2,3])=A
permute(A,[2,1,3])=A'
permute(A,[1,3,2])=
[1 2]',[3 8]',[2,7]'
permute(A,[3,1,2])=
[1 2],[3 8],[2,7]
permute(A,[2,3,1])=
[1 3 2]',[2 8 7]'
permute(A,[3,2,1])=
[1 3 2],[2 8 7]
-
MATLAB permute命令的操作逻辑
2019-12-20 11:32:30MATLAB中permute命令可以对高维矩阵的轴进行操作,例如使2*3*4的三维矩阵调整为4*2*3,那么具体函数内部进行了什么操作呢? 我们知道matlab里有两种坐标系,一种是我们熟知的笛卡尔坐标系,用命令axis xy实现,以二...MATLAB中permute命令可以对高维矩阵的轴进行操作,例如使2*3*4的三维矩阵调整为4*2*3,那么具体函数内部进行了什么操作呢?
我们知道matlab里有两种坐标系,一种是我们熟知的笛卡尔坐标系,用命令axis xy实现,以二维图为例,原点在左下角
还有一种是matlab中矩阵的索引体系,用命令axis ij实现,以二维图为例,原点在左上角
permute命令就是基于axis ij这种坐标轴下进行的操作
下面我们以一个三维矩阵的例子来说明命令permute的内部操作逻辑
A(:,:,1)=[1 2;3 4]; A(:,:,2)=[5 6;7 8]; A(:,:,3)=[9 10; 11 12]; 我们有 val(:,:,1) = 1 2 3 4 val(:,:,2) = 5 6 7 8 val(:,:,3) = 9 10 11 12
permute(a,order)操作分为两种情况
1.保持坐标轴关系不变
也就是order=[2 3 1]或[3 1 2]
这时候只用找到一个角度来重新观察这个矩阵即可
例如下图中所示
用MATLAB运行结果进行验证
D=permute(A,[2 3 1]); val(:,:,1) = 1 5 9 2 6 10 val(:,:,2) = 3 7 11 4 8 12
2,某两个轴进行交换
例如order = [1 3 2] [2 1 3] [3 2 1]
那么就是针对这两个轴的数据进行转置,如上图所示
用MATLAB运行结果进行验证
B=permute(A,[2 1 3]); val(:,:,1) = 1 3 2 4 val(:,:,2) = 5 7 6 8 val(:,:,3) = 9 11 10 12
-
matlab Permute Rearrange dimensions of N-D array
2012-07-09 14:23:38Syntax B = permute(A,order) ...B = permute(A,order) rearranges the dimensions of A so that they are in the order specified by the vector order. B has the same values of A but the
Syntax
B = permute(A,order)
Description
B = permute(A,order) rearranges the dimensions of A so that they are in the order specified by the vector order. B has the same values of A but the order of the subscripts needed to access any particular element is rearranged as specified by order. All the elements of order must be unique.
Tips
permute and ipermute are a generalization of transpose (.') for multidimensional arrays.
Examples
Given any matrix A, the statement
permute(A,[2 1])
is the same as A.'.
For example:
A = [1 2; 3 4]; permute(A,[2 1])
ans =
1 3
2 4
The following code permutes a three-dimensional array:
X = rand(12,13,14);
Y = permute(X,[2 3 1]);
size(Y)
ans =
13 14 12 -
Matlab permute( )函数 & 矩阵A 和矩阵A' 的差别 & imresize( )函数
2014-08-10 15:07:57Matlab 图像处理 Day9: 1、permute( ): % permute 函数功能是重新排列数组,可以交换数组的维数 % 对于二维数组而言、可以利用 permute 函数对矩阵进行转置 Sample:Matlab 图像处理 Day9:
1、permute( ):
% permute 函数功能是重新排列数组,可以交换数组的维数
% 对于二维数组而言、可以利用 permute 函数对矩阵进行转置
Sample:
2、矩阵A 和矩阵A’之间的差别:
A' 是举证 A 的转置矩阵.
3、imresize( ):
% 函数用于缩放处理
% 其一般形式为 <i> B = imresize(A, m)
B矩阵的长宽变成A矩阵的m倍,若 m > 1 ,则 B 为 A 的放大图像
若 m < 1 ,则 B 为 A 的缩小图像
<ii> B = imresize(A, [numrows numcols])
指定图像B的高度和宽度,即不是由图像A成比例的缩放,有可能会使图像变形
-
MATLAB中permute的运用
2015-06-13 16:04:27permute:Rearrange dimensions of N-D array Syntax:B = permute(A,order) Description:B = permute(A,order) rearrangesthe dimensions of A so that they are in the orderspecified by the vector order... -
Matlab GUI之permute()函数与msdbox()函数
2016-07-15 21:06:24一、permute permute(A,[3,2,1])使A的维号按照先第3维、再第2维,最后第1维的顺序排列 官方文档给了二维的例子,不过没有给3维的形象 permute(A,[2 1]) is the same as A.'. For example: A = [1 2; 3 4]; permute... -
Matlab中repmat、permute函数用法
2018-01-16 21:36:13B = permute(A,order) 对N维数组A按照指定的向量order顺序来重新排列其维数,B和A有相同的值但是任何需要访问的特定元素其下标的顺序是被指定的向量order顺序来重新排列的,向量order中的元素必须是唯一的。 ... -
Matlab 高维矩阵与向量的点乘 (Permute)
2021-01-06 12:35:45Matlab 高维矩阵与向量的点乘 (Permute) 今天遇到一个问题,如何用一个n维的向量点乘一个m×k×nm\times k\times nm×k×n 的矩阵, 并避免用循环。Matlab矩阵实验室名不虚传,通过permute这个命令可以有效解决这... -
matlab api: shiftdim, permute
2015-02-09 11:16:00permute的功能比shiftdim强大,可以实现维号的任意顺序排列(或称置换),而shiftdim只是permute按左移(或右移)排列(数学上称为轮换)的一个特例。 转载于:https://www.cnblogs.com/octave/p/4281060.html -
matlab---之permute,im2double,double
2017-11-29 18:53:32转载:https://zhidao.baidu.com/question/290414065.html ...1permute permute(多维数组,[维数的组合]) 比如: a=rand(2,3,4); %这是一个三维数组,各维的长度分别为:2,3,4 %现 -
(转)Matlab 矩阵操作函数- reshape repmat permute squeeze flip
2019-08-22 10:24:26原 Matlab 矩阵操作函数- reshape repmat permute squeeze flip ... -
matlab 交换矩阵维度------ permute函数
2018-07-08 20:18:03permute(A,[2,1,3]),若A是一个3维矩阵,此行代码交换矩阵A的第一维与第二维。 -
Matlab 矩阵操作函数- reshape repmat permute squeeze flip
2016-03-09 13:51:07Matlab 中经常需要对矩阵进行维度上的操作,下面做一个简单的总结: 在Matlab中,不管矩阵的维度是多少,数据在内存中的存储都是按照 “行-列-页” 的顺序进行存储的。比如:>> a = [11,12,13; 21,22,23] a = ... -
matlab学习笔记11_3高维数组操作 filp, shiftdim, size, permute, ipermute
2019-10-29 15:44:08一起来学matlab-matlab学习笔记11 11_3 高维数组处理和运算 filp, shiftdim, size, permute, ipermute 觉得有用的话,欢迎一起讨论相互学习~Follow Me filp 翻转元素顺序 语法 B = flip(A) B = flip(A,dim) 说明 B ... -
Matlab矩阵操作函数的使用(reshape,imresize,remat,permute)
2019-10-05 05:35:51permute是维度转换的矩阵,如f=permute(a,[2,1]),则有 \(f=\begin{bmatrix} 1 &4 \\ 2&5 \\ 3& 6 \end{bmatrix}\) 即将原来 \(2\times3\) 维的矩阵a变成 \(3\times2\) 维的矩阵f。 转载于:... -
matlab中repmat函数, ndims 函数 与 expand 函数 reshape函数,shiftdim函数和permute函数的用法
2017-07-31 13:45:58B = repmat(A,m,n) B = repmat(A,[m n]) ...permute的功能比shiftdim强大,可以实现维号的任意顺序排列(或称置换),而shiftdim只是permute按左移(或右移)排列(数学上称为轮换)的一个特例。 -
SSD网络解析之Permute层
2018-12-10 17:20:29Permute层是SSD(Single Shot MultiBox Detector)中用于置换索引轴顺序的,与matlab中的permute()函数实现类似的功能,首先我们看一下caffe.proto中关于该层参数的说明: optional PermuteParameter permute_param ... -
MATLAB中在一个三维矩阵中如何提取出一个二维矩阵,使用permute
2015-01-12 10:23:00MATLAB 、 FreeMat 中,该函数按指定的向量来重新排列一个 数组 。 语法格式: B = permute(A,order) 按照向量order指定的顺序重排A的各维。B中元素和A中元素完全相同。但由于经过重新排列,在A、B访问同一个... -
Matlab 5. 常用的数据处理函数:cat,zscore,permute,bsxfun,floor,.*和*。
2017-03-02 14:41:525. permute函数:A=permute(B,[2,1]),同样在这里1代表行,2代表列,3代表第三维.... 表示将矩阵B的行和列的元素进行对调。 举例: >> B = magic(3) B = 8 1 6 3 5 7 4 9 2 >> A = permute(B... -
make #permute_columns more intuitive to use
2020-12-28 09:27:50I got surprised by the behaviour of <code>#permute_columns, which is very inconvenient for everybody who is used to Matlab or R (and I think that this surprising behaviour is also not explicitly ...
-
【Python-随到随学】 FLask第一周
-
ASHRAE 2012 IT Equipment Thermal Management and Controls_V1.0.pdf
-
2014年上半年 信息系统管理工程师 上午试卷 综合知识 软考真题【含答案和答案解析】
-
2013年上半年 信息系统监理师 上午试卷 综合知识 软考真题【含答案和答案解析】
-
access应用的3个开发实例
-
ASP.NET学习——用户增删改查(三层,数据库+源码)
-
path.js:39 throw new ERR_INVALID_ARG_TYPE(‘path‘, ‘string‘, path);
-
量子差分密码分析
-
C++11 14 17 20 多线程从原理到线程池实战
-
Siamese Network (应用篇3) :孪生网络用于图像块匹配 ACCV2016
-
详解敏捷测试
-
Flutter布局详解
-
2019年下半年 网络工程师 上午试卷 综合知识 软考真题【含答案和答案解析】
-
在 Linux 上构建企业级 DNS 域名解析服务
-
程序员必修基础套餐课
-
朱老师C++课程第3部分-3.6智能指针与STL查漏补缺
-
通过新颖的二元君主蝶优化算法解决0-1背包问题
-
iptables 企业级防火墙配置(四表五链)
-
*区间(dp)
-
基于python的dango框架购物商城毕业设计毕设源代码使用教程