How to cut the signal from a specific point?

16 ビュー (過去 30 日間)
Malahat Mehraban
Malahat Mehraban 2022 年 5 月 2 日
コメント済み: Voss 2022 年 5 月 2 日
Hello everyone,
I have two signals with different length and I want to cut one of them to have two signals with the same length.
I have attached the figure that shows the two signals. I want to cut the section which is in the red circle.
Thank you in advance for your help

採用された回答

Voss
Voss 2022 年 5 月 2 日
First, I create some random signals, to approximate the situation:
green_signal = 0.4*rand(1,265);
blue_signal = rand(1,210);
NG = numel(green_signal);
Now I make a plot similar to yours:
subplot(2,1,1)
plot(blue_signal,'b');
hold on
plot(green_signal,'g');
title('original')
xlim([1 NG]);
Now, perform the cutting of the "green" signal:
green_signal(numel(blue_signal)+1:end) = [];
Now another plot after cutting:
subplot(2,1,2)
plot(blue_signal,'b');
hold on
plot(green_signal,'g');
xlim([1 NG]);
title('after cutting green signal')
  2 件のコメント
Malahat Mehraban
Malahat Mehraban 2022 年 5 月 2 日
it works well, thank you for your quick answer.
Voss
Voss 2022 年 5 月 2 日
You're welcome!

サインインしてコメントする。

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeMatched Filter and Ambiguity Function についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by