📄 splot2h.m
字号:
function splot2h(estDirSpec,plotType)% *****************************************************************************% * DBT, A Matlab Toolbox for Radar Signal Processing *% (c) FOA 1994-2000. See the file dbtright.m for copyright notice.%% function splot2h(estDirSpec,plotType)%% Plots a DOA-spectrum, either a power spectrum or a pseudo% spectrum.%% estDirSpec EstDirSpecT% plotType StringT plotType(1,1) = 'd' : logaritmic y-axis or% 'l' : linear y-axis.% ' ' : Default y-axis type.% plotType(1,3:5)= see 'linetype' for the usual% Matlab 'plot' command.%% Start : 951220 Svante Bj鰎klund (svabj).% Latest change: $Date: 2000/10/16 15:22:10 $ $Author: svabj $.% $Revision: 1.16 $% *****************************************************************************floorLevel = -70; % Values below this [dB] is not plotted in % logaritmic plots.cax = newplot;% NEWPLOT% "does the right thing" in terms of determining which axes and/or% figure to draw the plot in, based upon the setting of the% NextPlot property of axes and figure objects, and returns a% handle to the appropriate axes.% ----------------------------------------------------------------------- %% Pick out fields from record variables.% ----------------------------------------------------------------------- %chkdtype(estDirSpec, 'DoaSpecT')if (estDirSpec.version < 4) error(['DBT-Error: Too old version of input parameter "estDirSpec". ',... 'Probably because a definition of the "DoaSpecT" variable ',... 'somewhere else than in function "DoaSpecT".'])end%ifspectrum = estDirSpec.specSmpl;doas = estDirSpec.doaPos;thetasvepg = r2d(doas(1,:));if (nargin == 1) plotType = 'da-';endif (size(plotType,2) == 0) plotType = 'da-';endif (size(plotType,2) == 1) plotType = [plotType 'a-'];endif (size(plotType,2) == 2) plotType = [plotType '-'];endyAxisType = plotType(1,1);xAxisType = plotType(1,2);lineType = plotType(1,3:size(plotType,2));if ((yAxisType == ' ')) yAxisType = 'd';end%ifif ((xAxisType == ' ')) xAxisType = 'a';end%if% ------------------------------------------------------------------------- %% Plot% ------------------------------------------------------------------------- %if strcmp(xAxisType,'s') thetasvepg = sin(d2r(thetasvepg));elseif strcmp(xAxisType,'a') % Do nothing.else error('DBT-Error: Unknown x-axis type.');endif strcmp(yAxisType,'l') plot(thetasvepg, (abs(spectrum))./max(abs(spectrum)), lineType) axis([thetasvepg(1,1), thetasvepg(1,size(thetasvepg,2)), 0, 1]) ylabel('Normalized directional spectrum [linear]')elseif strcmp(yAxisType,'d') plot(thetasvepg, 10*log10(abs(spectrum)+eps), lineType)% plot(thetasvepg, max(10*log10((abs(spectrum))./max(abs(spectrum))),floorLevel), lineType) ylabel('Directional spectrum [dB]')else error('DBT-Error: Unknown y-axis type.');endif strcmp(xAxisType,'s') xlabel('Direction: sin(angle)')elseif strcmp(xAxisType,'a') xlabel('Direction [degrees]')else error('DBT-Error: Unknown x-axis type.');endtitle(estDirSpec.spectrumType)grid on%plotType(1,2:size(plotType,2))
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -