フィルターのクリア

I want a draw a line parallel to x axis in the existing graph while plotting itself

11 ビュー (過去 30 日間)
Dhruwal Dilipbhai Bhimani
Dhruwal Dilipbhai Bhimani 2021 年 10 月 28 日
回答済み: Star Strider 2021 年 10 月 28 日
%Noisy data
ND=importdata('Noisydata.txt');
x3=ND(:,1);
y3=ND(:,2);
subplot(3,2,6);
plot(x3,y3)
title('Noisy Data')
Now I want to draw a line while this graph gets plotted as shown in the figure attached.

回答 (1 件)

Star Strider
Star Strider 2021 年 10 月 28 日
Try something like this —
x = 1:20;
y = randn(size(x));
xi = linspace(min(x), max(x), numel(x)*10);
yi = interp1(x, y, xi);
Lv = yi > 0;
zv = zeros(size(xi));
figure
plot(x, y)
hold on
patch([xi flip(xi)], [zv flip(yi.*Lv)], 'k', 'FaceAlpha',0.75)
hold off
grid
Experiment with the ‘Noisydata.txt’ signal.
.

カテゴリ

Help Center および File Exchange2-D and 3-D Plots についてさらに検索

タグ

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by