Matlab的频谱图函数是否会以任何方式锁定创建的图形? 我想在图形上画垂直线,但线条函数似乎没有起到作用。 我如何在Matlab频谱图上绘制一条线?
clc; clear all; close all;
[data, fs, nbits] = wavread(<INSERT WAVE FILE HERE>);
% [data, fs, nbits] = wavread('white_0.05_6sec_aud.wav');
N_data=length(data); N_frame=128; N_half=N_frame/2; N_loop=N_data/(N_half);
output=zeros(N_data,1);
hz=0:(fs/2)/N_half:(fs/2)-(fs/2)/N_half;
spectrogram(data, hanning(N_frame), N_half, N_frame, fs);
x = [6500 6500];
y = [0 5.5];
H = gca;
% set(gca, 'NextPlot', 'add');
% line(x, y);
h = line([6500, 6500], [0, 5.5]);
set(h, 'parent', handles.predicted_ax);
% view(-90,90)
% set(gca,'ydir','reverse')
%
% [y, x] = ginput(1)
% view(-90, 180);