plotreflncoefft.m
来自「水声模型 很不错的东西」· M 代码 · 共 60 行
M
60 行
function NewDir = PlotReflnCoefft(DfltDir)
Here = pwd;
NewDir = Here;
if nargin >= 1
DirStat = 1;
if ~exist(DfltDir, 'dir')
DirStat = LibMakeDirectory(DfltDir);
end
if DirStat
cd(DfltDir);
NewDir = DfltDir;
end
end
[File, Path] = uigetfile('*.brc', 'Reflection coefft file');
cd(Here);
if File ~= 0
NewDir = Path;
InFile = fopen([Path File], 'rt');
NPt = fscanf(InFile, '%f', 1);
InDat = fscanf(InFile, '%f', [3, NPt]);
Theta = InDat(1, :);
Mag = InDat(2, :);
Phase = InDat(3, :);
Ans = inputdlg({...
'Figure number', ...
'Hold current plot (y/n)', ...
'Line style'}, '', 1, {int2str(gcf), 'n', 'b-'});
if ~isempty(Ans)
FigNum = str2num(Ans{1});
HoldCurrent = strcmpi(Ans{2}, 'y');
Style = Ans{3};
figure(FigNum);
if ~HoldCurrent
clf;
if exist('GUI_SetupGraphMenu.m', 'file')
GUI_SetupGraphMenu('plot');
end
end
subplot(2,1,1);
hold on;
plot(Theta, Mag, Style);
ylabel('Magnitude');
title(['Bottom reflection coefficient - ' File], 'Interpreter', 'none');
subplot(2,1,2);
hold on;
plot(Theta, Phase, Style);
ylabel('Phase (deg)');
xlabel('Grazing angle (deg)');
end
fclose(InFile);
end
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?