Is there any way to increase the density of curve samples?

7 ビュー (過去 30 日間)
Abdulaziz Abutunis
Abdulaziz Abutunis 2017 年 6 月 3 日
コメント済み: Vandana Rajan 2017 年 6 月 15 日
Dear fellows,
I have a plot of multiple curves and I want, if possible, to increase the density of these curves (increase the data). It looks like be some thing that uses fitting tool or interpolation tool but I was not able to find any. I appreciate your help.
Thanks in advance Aziz

採用された回答

Vandana Rajan
Vandana Rajan 2017 年 6 月 13 日
Hi,
Why don't you use the 'interp' function to interpolate the data and then plot it? Below is an example code snippet from the documentation.
t = 0:0.001:.029; % Time vector
x = sin(2*pi*30*t) + sin(2*pi*60*t); % Original Signal
y = interp(x,4); % Interpolated Signal
subplot(211);
stem(x);
title('Original Signal');
subplot(212);
stem(y);
title('Interpolated Signal');
  2 件のコメント
Abdulaziz Abutunis
Abdulaziz Abutunis 2017 年 6 月 13 日
Thank you Vandana, Actually I tried this method but the thing I wanted was to have a regular "plot" because I had many curves on the plot.
Thanks Aziz
Vandana Rajan
Vandana Rajan 2017 年 6 月 15 日
Hi,
In the same code snippet, if you change 'stem' to 'plot', you can see the effect of interpolation. The sharp edges on the curve (due to lack of data in between 2 points) becomes smooth as interpolation increases data samples in between them.

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

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeInterpolation についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by