Discover MakerZone

MATLAB and Simulink resources for Arduino, LEGO, and Raspberry Pi

Learn more

Discover what MATLAB® can do for your career.

Opportunities for recent engineering grads.

Apply Today

Thread Subject:
Extrapolate / Iterpolate Datas....

Subject: Extrapolate / Iterpolate Datas....

From: Florent Kadrija

Date: 3 Apr, 2012 11:37:13

Message: 1 of 2

Hi,

I have the following problem, but as I am new to Matlab this seems to be quite challenge for me, so I need your help:

I have the following(below) say vector, filled with data and NaN symbols. What I want ist I want to extrapolate or interpolate ( I dont know which) so that I dont have these NaN symbols.

Can anybody help me to do this?

0.4380 - 2.0858i
      NaN
   1.1381 - 1.7776i
   0.4934 - 0.2249i
      NaN
  -0.2806 - 0.7021i
  -0.2908 - 0.6596i
      NaN
   0.9207 + 0.0883i
   2.0612 - 2.0362i
      NaN
   1.9475 - 0.7377i
   1.6053 - 1.0519i
      NaN
   0.5021 - 0.9568i
   1.6167 + 0.3925i
      NaN
  -1.5612 - 0.4240i
  -1.3277 - 0.5988i
      NaN
  -2.6795 - 1.1293i
  -1.2990 + 1.6889i
      NaN
  -0.5581 + 0.7484i
   1.3174 + 0.4652i
      NaN
  -1.6281 + 1.6226i
   0.1978 - 0.7598i
      NaN
   1.5543 + 0.1663i
  -1.5253 + 2.3218i
      NaN
   0.8065 - 0.1719i
   0.8805 + 0.3054i
      NaN
   0.8936 - 0.5941i
   0.6018 + 1.0634i
      NaN
  

Subject: Extrapolate / Iterpolate Datas....

From: John D'Errico

Date: 3 Apr, 2012 13:53:19

Message: 2 of 2

"Florent Kadrija" <florent.kadrija@gmail.com> wrote in message <jlend9$e76$1@newscl01ah.mathworks.com>...
> Hi,
>
> I have the following problem, but as I am new to Matlab this seems to be quite challenge for me, so I need your help:
>
> I have the following(below) say vector, filled with data and NaN symbols. What I want ist I want to extrapolate or interpolate ( I dont know which) so that I dont have these NaN symbols.
>
> Can anybody help me to do this?
>
> 0.4380 - 2.0858i
> NaN
> 1.1381 - 1.7776i
> 0.4934 - 0.2249i
> NaN
> -0.2806 - 0.7021i
> -0.2908 - 0.6596i
> NaN
> 0.9207 + 0.0883i
> 2.0612 - 2.0362i
> NaN
> 1.9475 - 0.7377i
> 1.6053 - 1.0519i
> NaN
> 0.5021 - 0.9568i
> 1.6167 + 0.3925i
> NaN
> -1.5612 - 0.4240i
> -1.3277 - 0.5988i
> NaN
> -2.6795 - 1.1293i
> -1.2990 + 1.6889i
> NaN
> -0.5581 + 0.7484i
> 1.3174 + 0.4652i
> NaN
> -1.6281 + 1.6226i
> 0.1978 - 0.7598i
> NaN
> 1.5543 + 0.1663i
> -1.5253 + 2.3218i
> NaN
> 0.8065 - 0.1719i
> 0.8805 + 0.3054i
> NaN
> 0.8936 - 0.5941i
> 0.6018 + 1.0634i
> NaN

WTP? Its on the file exchange.

http://www.mathworks.com/matlabcentral/fileexchange/4551-inpaintnans

x = inpaint_nans(x)
x =
        0.438 - 2.0858i
        0.987 - 2.2114i
       1.1381 - 1.7776i
       0.4934 - 0.2249i
      0.00065 - 0.2118i
      -0.2806 - 0.7021i
      -0.2908 - 0.6596i
      0.12317 + 0.075517i
       0.9207 + 0.0883i
       2.0612 - 2.0362i
       2.2515 - 1.6887i
       1.9475 - 0.7377i
       1.6053 - 1.0519i
       0.8109 - 1.2816i
       0.5021 - 0.9568i
       1.6167 + 0.3925i
       0.1746 + 0.23827i
      -1.5612 - 0.424i
      -1.3277 - 0.5988i
      -2.1948 - 1.3629i
      -2.6795 - 1.1293i
       -1.299 + 1.6889i
      -1.0111 + 1.7356i
      -0.5581 + 0.7484i
       1.3174 + 0.4652i
     -0.14708 + 1.3938i
      -1.6281 + 1.6226i
       0.1978 - 0.7598i
       1.6936 - 1.0531i
       1.5543 + 0.1663i
      -1.5253 + 2.3218i
       -0.885 + 1.3547i
       0.8065 - 0.1719i
       0.8805 + 0.3054i
      0.94802 - 0.34105i
       0.8936 - 0.5941i
       0.6018 + 1.0634i
         0.31 + 2.7209i

John

Tags for this Thread

What are tags?

A tag is like a keyword or category label associated with each thread. Tags make it easier for you to find threads of interest.

Anyone can tag a thread. Tags are public and visible to everyone.

Contact us