www.gusucode.com > bioinfo 案例源码程序 matlab代码 > bioinfo/ResampleMassSpectrometryDataExample.m

    %% Resample Mass Spectrometry Data
% This example shows how to resample mass spec data.

% Copyright 2015 The MathWorks, Inc.


%%
% Load a MAT-file, included with Bioinformatics Toolbox(TM),
% that contains mass spectrometry data, and then extract m/z and intensity
% value vectors.
load sample_hi_res;
mz = MZ_hi_res;
y = Y_hi_res;

%%
% Plot the original data.
plot(mz, y, '.')

%%
% Resample the spectrogram to have 10000 samples between 2000 and maximum
% m/z value in the data set, and show both the resampled and original data.
[mz1,y1] = msresample(mz, y, 10000, 'range',[2000 max(mz)],'SHOWPLOT',true);