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:
DIscrete data

Subject: DIscrete data

From: mshahrashoub shahrashoub

Date: 31 Aug, 2010 12:51:07

Message: 1 of 3

Hi,

I want to ask, are there any way/function to scale data.

I have a matrix

Ex : DataM % Matrix

to discrete it, I am using

minValue = min(DataM (:)); %MInimim value
maxValue = max(DataM (:)); % Maximum Value

DataM = DataM -minValue ;

DataM = Scale * (DataM ./ maxValue); % Rescale matrix ,amount of scale

My question is when I use this code, are there any data loss on data ?
(Values that I am working on so small and noisy)

Thanks in Advance

Subject: DIscrete data

From: Roger Stafford

Date: 31 Aug, 2010 20:23:20

Message: 2 of 3

" mshahrashoub shahrashoub" <shahrashoub@yahoo.com> wrote in message <i5itrq$e8b$1@fred.mathworks.com>...
> Hi,
>
> I want to ask, are there any way/function to scale data.
>
> I have a matrix
>
> Ex : DataM % Matrix
>
> to discrete it, I am using
>
> minValue = min(DataM (:)); %MInimim value
> maxValue = max(DataM (:)); % Maximum Value
>
> DataM = DataM -minValue ;
>
> DataM = Scale * (DataM ./ maxValue); % Rescale matrix ,amount of scale
>
> My question is when I use this code, are there any data loss on data ?
> (Values that I am working on so small and noisy)
>
> Thanks in Advance
- - - - - - - - -
  Provided you know the previous maximum and minimum values of DataM, there should essentially be no loss of information in your scaling process. Dividing by Scale, multiplying by that maximum, and then adding that minimum brings you back to the original data except for round-off errors, which are usually of the order a few parts in 1e16.

  Of course if the maximum and minimum are very close together and a long way from zero, the round-off error can be much larger. For example if the maximum = 1e5 and minimum = maximum-1, then you will lose roughly five decimal places of accuracy (out of sixteen) in such a restoration.

  Is this the sort of thing you meant by "data loss"?

Roger Stafford

Subject: DIscrete data

From: mshahrashoub shahrashoub

Date: 1 Sep, 2010 07:58:09

Message: 3 of 3

"Roger Stafford" <ellieandrogerxyzzy@mindspring.com.invalid> wrote in message <i5jobo$a3h$1@fred.mathworks.com>...
> " mshahrashoub shahrashoub" <shahrashoub@yahoo.com> wrote in message <i5itrq$e8b$1@fred.mathworks.com>...
> > Hi,
> >
> > I want to ask, are there any way/function to scale data.
> >
> > I have a matrix
> >
> > Ex : DataM % Matrix
> >
> > to discrete it, I am using
> >
> > minValue = min(DataM (:)); %MInimim value
> > maxValue = max(DataM (:)); % Maximum Value
> >
> > DataM = DataM -minValue ;
> >
> > DataM = Scale * (DataM ./ maxValue); % Rescale matrix ,amount of scale
> >
> > My question is when I use this code, are there any data loss on data ?
> > (Values that I am working on so small and noisy)
> >
> > Thanks in Advance
> - - - - - - - - -
> Provided you know the previous maximum and minimum values of DataM, there should essentially be no loss of information in your scaling process. Dividing by Scale, multiplying by that maximum, and then adding that minimum brings you back to the original data except for round-off errors, which are usually of the order a few parts in 1e16.
>
> Of course if the maximum and minimum are very close together and a long way from zero, the round-off error can be much larger. For example if the maximum = 1e5 and minimum = maximum-1, then you will lose roughly five decimal places of accuracy (out of sixteen) in such a restoration.
>
> Is this the sort of thing you meant by "data loss"?
>
> Roger Stafford

I mean the round-off error. But I got my answer. Thank you.

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