mdsum.m
来自「利用HMM的方法的三种语音识别算法」· M 代码 · 共 25 行
M
25 行
function [A]=mdsum(B,dim);% A = mdsum(B,dim)% Summation over multiple dimensions% sums over all dimensions specified in vector <dim> which % must start with the largest dimension down to the smallest% the sum is returned in A%% example:% X=round(10*rand(2,2,2,2));% dim=[3 4];% Y=mdsum(X,dim);% disp([sum(sum(X(1,1,:,:))), Y(1,1)])%dim=flipud(sort(dim(:))); % sort in decending orderA=B;if max(dim)>length(size(A)), error('Integrating Dimensions do not match N-D Array dimensions');end;for n=1:length(dim) A=sum(A,dim(n));end; A=squeeze(A);
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?