axisrescale.m
来自「此为频谱分析工具箱」· M 代码 · 共 57 行
M
57 行
function [new_x, p] = axisrescale(x, pmat, order,last)% axisrescale : Rescales an axis by Lagrange interpolation%Syntax: [new_x, p] = axisrescale(x, pmat, {order=2,mode='silent'})%% This function rescales an x axis using polynomial interpolation.% 'pmat' is a matrix of rows [old_x new_x].% returns new axis and interpolation polynome.% Author: EF <manuf@ldv.univ-montp2.fr>% Description: rescales an axis by Lagrange interpolation% uses : interp.m% Part of 'Spectral tools'. E.Farhi. 07/96if (nargin < 2) error('usage : new_x = axisrescale(x, pmat, {order=2,mode=''silent''})');endif ~exist('order') order = 2;endif isempty(order) order = 2;endif ~exist('last') last = 'silent';endif isempty(last) last = 'silent';endif strcmp(last,'silent') tmp = 0;else tmp = 1;endnp = size(pmat,1);if (np < 2) error('need at least 2 points in interpolation matrix.');endlx = length(x);if tmp fprintf(1,'\nusing order %i rescaling on %i points.\n', order, lx);end[a, p] = interpsp(pmat(:,1) , pmat(:,2), pmat(ceil(np/2),1), np, order);new_x = polyval(p, x);if tmp fprintf(1,'interpolation polynome is [ n..1 ] :'); disp(p);end
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?