上午遇到了同样的问题,加了条语句set函数对线型设置。你可以将set注释上看看效果
clc;
clear all;
x1=[0 ,1 ,1 ,0];
y1=[0, 0, 1 ,1]; %定义四个点 [0 0] [1 0] [1 1] [0 1]
H_F1=fill(x1,y1,[0.0, 0.1, 0.2 ,0.5]); %定义四个点的C值
set(H_F1,{'LineStyle'},{'none'}) %设置颜色和线宽
hold on
x2=[1 ,2 ,2 ,1];
y2=[1, 1, 2 ,2];
H_F2=fill(x2,y2,[0.3, 0.2, 0.2 ,0.7]); %定义四个点的C值
set(H_F2,{'LineStyle'},{'none'}) %设置颜色和线宽
hold on
x3=[0 ,1 ,1 ,0];
y3=[1, 1, 2 ,2];
H_F3=fill(x3,y3,[0.5, 0.1, 0.4 ,0.5]); %定义四个点的C值
set(H_F3,{'LineStyle'},{'none'}) %设置颜色和线宽
hold on
x4=[1 ,2 ,2 ,1];
y4=[0, 0, 1 ,1];
H_F4=fill(x4,y4,[0.5, 0.1, 0.4 ,0.5]); %定义四个点的C值
set(H_F4,{'LineStyle'},{'none'}) %设置颜色和线宽
2015-08-01 · 知道合伙人数码行家
clear
clc
%% 初始化值
dt=0.001;% The sample interval, you can also set it to 0.001 or 0.004.
xt=0.06;% The length of wavelet(s), you can change it.
ht=0.3; % The length of h(t), namely reflection coefficient.
fm=40; % The main frequency of Ricker wavelet, you can change it.
%% 生成Ricker子波
nw=xt/dt;
nw=2*floor(nw/2)+1;
nc=floor(nw/2);
i=1:nw;
alpha=(nc-i+1).*fm*dt*pi;
beta=alpha.^2;
w=(1.-beta.*2).*exp(-beta);
m=length(w);
subplot(311),plot(w,'k');
title('雷克子波');
%% 生成反射系数序列
ny=ht/dt;
for i=0:ny
h=0.0;
end
h(20)=0.5;
h(80)=-0.5;
h(130)=0.5;
h(135)=-0.5;
h(300)=0.0;
n=length(h);
subplot(312),plot(h,'k');
title('反射系数');
%% 求卷积并得到合成地震记录
y=conv(w,h);
j=0:n-1;
y1=y(j+nc);
%subplot(313),plot(y1,'k');
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
N = length(y1);
NN = 1 : N;
test_p = y1;
test_m = y1;
for ii = 1 : N
if(test_p(ii) <= 0)
test_p(ii) = 0;
end
if(test_m(ii) <= 0)
test_m(ii) = 0;
end
end
subplot(313),fill(NN,test_p,'k');
% subplot(313),fill(NN,test_m,'w');
hold on;
subplot(313),plot(y1,'k');
hold off;
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
title('合成记录');
好像不对,你说的再详细点啊