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:
interp1 can't distinct between very small values

Subject: interp1 can't distinct between very small values

From: Sebastian Gatzka

Date: 7 Dec, 2010 09:58:04

Message: 1 of 2

Hi all.

As a matter of fact interp1 can't distinct between very small values and differences in one of the input variables.

They first ten entries look like this (when viewed with the array editor):

0
3,55345839896210e-23
2,50052405022539e-09
1,50031443013522e-08
7,75162455569861e-08
3,90081751835156e-07
1,95290928322600e-06
9,76704694018024e-06
4,88377352249514e-05
0,000244191176648807

Obviously most of them are treated a zero from inside interp1.
This is why the function returns "The values of X should be distinct".

Is there a way to overcome this problem without using unique?

Thanks you.
sega

Subject: interp1 can't distinct between very small values

From: user

Date: 7 Dec, 2010 10:11:05

Message: 2 of 2

"Sebastian Gatzka" <sebastian.gatzka.NOSPAM@stud.tu-darmstadt.de> wrote in message <idl0fc$f7e$1@fred.mathworks.com>...
> Hi all.
>
> As a matter of fact interp1 can't distinct between very small values and differences in one of the input variables.
>
> They first ten entries look like this (when viewed with the array editor):
>
> 0
> 3,55345839896210e-23
> 2,50052405022539e-09
> 1,50031443013522e-08
> 7,75162455569861e-08
> 3,90081751835156e-07
> 1,95290928322600e-06
> 9,76704694018024e-06
> 4,88377352249514e-05
> 0,000244191176648807
>
> Obviously most of them are treated a zero from inside interp1.
> This is why the function returns "The values of X should be distinct".
>
> Is there a way to overcome this problem without using unique?
>
> Thanks you.
> sega
Hi
Try to change the format of nuemric values.
format long e
and try out intrpl
HTH,
Saif

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