How can I sum two plots that don´t have the same number of elements?

1 回表示 (過去 30 日間)
Andriy Voshchenko
Andriy Voshchenko 2022 年 5 月 26 日
コメント済み: Sam Chak 2022 年 5 月 27 日
I have the following case which represents the pressure distribution over a profile:
I want to separate the intrados and extrados sections and calculate the sum of it. I´ve divided my data but the 2 parts don´t have the same number of elements. For example, I have 170 data points for the entire plot and 94 of them are data from intrados and the rest is extrados.
I can divide it and represent it:
but I have troubles with performing the sum. I need to create extra points somehow so the 2 data sets have the same number, how can I do it?

採用された回答

Sam Chak
Sam Chak 2022 年 5 月 26 日
I think one of the methods is to perform data interpolation using interp1 so that both curves are interpolated at the same point coordinates.
https://www.mathworks.com/help/matlab/ref/interp1.html
  6 件のコメント
Andriy Voshchenko
Andriy Voshchenko 2022 年 5 月 27 日
Oh, that´s actually more useful. Will probably need to solve more cases so the automatic detection and separation on intrados/extrados will accelerate things a lot. Will try to implement it now. Thanks a lot!
Sam Chak
Sam Chak 2022 年 5 月 27 日
You are welcome, @Andriy Voshchenko.

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

その他の回答 (0 件)

カテゴリ

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

製品


リリース

R2021b

Community Treasure Hunt

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

Start Hunting!

Translated by