📄 axisrescale.m
字号:
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 + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -