postpad2.m
来自「Matlab时频分析工具箱,希望能对大家有所帮助啊」· M 代码 · 共 43 行
M
43 行
function xo = postpad2(x, L1,L2)%POSTPAD2 Pad or truncate matrix to specified size.% % Pads or truncates a matrix x to specified dims L1 and L2.%% The function does not check input parameters.%% This program is free software: you can redistribute it and/or modify% it under the terms of the GNU General Public License as published by% the Free Software Foundation, either version 3 of the License, or% (at your option) any later version.% % This program is distributed in the hope that it will be useful,% but WITHOUT ANY WARRANTY; without even the implied warranty of% MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the% GNU General Public License for more details.% % You should have received a copy of the GNU General Public License% along with this program. If not, see <http://www.gnu.org/licenses/>.xs1=size(x,1);xs2=size(x,2);% Trap the do-nothing case.if xs1==L1 && xs2==L2 xo=x; return;end;xo=zeros(L1,L2);% Minimum size along each dimension.xm1=min(xs1,L1);xm2=min(xs2,L2);xo(1:xm1,1:xm2)=x(1:xm1,1:xm2);
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?