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:
Importing from Excel

Subject: Importing from Excel

From: Mercu Vestergaard

Date: 9 Aug, 2013 12:16:07

Message: 1 of 5

I am currently trying to import some data from Excel to matlab, however I have a problem:

I am using: xlsread('directory', 'sheet')

However first of all: I have done some manipulations in excel on some of the data, more specificly transformed some of the data into, logs.

However when I import the data, into an array, all of the "log" data, shows up as values such as 0.0001, whereas the data that is not given in logs, appears "normal"?

How do I get rid of that problem?

Subject: Importing from Excel

From: someone

Date: 9 Aug, 2013 19:26:09

Message: 2 of 5

"Mercu Vestergaard" wrote in message <ku2mi7$s8g$1@newscl01ah.mathworks.com>...
> I am currently trying to import some data from Excel to matlab, however I have a problem:
>
> I am using: xlsread('directory', 'sheet')
>
> However first of all: I have done some manipulations in excel on some of the data, more specificly transformed some of the data into, logs.
>
> However when I import the data, into an array, all of the "log" data, shows up as values such as 0.0001, whereas the data that is not given in logs, appears "normal"?
>
> How do I get rid of that problem?

Can you be a little more specific?

What values are expecting - if not 0.0001?

What does "normal" mean?

Is the problem simply the number of significant digits that are displayed?

Subject: Importing from Excel

From: Mercu Vestergaard

Date: 9 Aug, 2013 20:21:08

Message: 3 of 5

"someone" wrote in message <ku3foh$9oc$1@newscl01ah.mathworks.com>...
> "Mercu Vestergaard" wrote in message <ku2mi7$s8g$1@newscl01ah.mathworks.com>...
> > I am currently trying to import some data from Excel to matlab, however I have a problem:
> >
> > I am using: xlsread('directory', 'sheet')
> >
> > However first of all: I have done some manipulations in excel on some of the data, more specificly transformed some of the data into, logs.
> >
> > However when I import the data, into an array, all of the "log" data, shows up as values such as 0.0001, whereas the data that is not given in logs, appears "normal"?
> >
> > How do I get rid of that problem?
>
> Can you be a little more specific?
>
> What values are expecting - if not 0.0001?
>
> What does "normal" mean?
>
> Is the problem simply the number of significant digits that are displayed?

Hey,

by "normal" i mean in levels.

I looked at bit more in detail, and realized that the data provided in logs, shows up as if it has been divided by 10000.

I know that I could simply just "multiply" by 10000, however it would be nice to be able to import it directly.

Subject: Importing from Excel

From: Mercu Vestergaard

Date: 9 Aug, 2013 20:23:07

Message: 4 of 5

"someone" wrote in message <ku3foh$9oc$1@newscl01ah.mathworks.com>...
> "Mercu Vestergaard" wrote in message <ku2mi7$s8g$1@newscl01ah.mathworks.com>...
> > I am currently trying to import some data from Excel to matlab, however I have a problem:
> >
> > I am using: xlsread('directory', 'sheet')
> >
> > However first of all: I have done some manipulations in excel on some of the data, more specificly transformed some of the data into, logs.
> >
> > However when I import the data, into an array, all of the "log" data, shows up as values such as 0.0001, whereas the data that is not given in logs, appears "normal"?
> >
> > How do I get rid of that problem?
>
> Can you be a little more specific?
>
> What values are expecting - if not 0.0001?
>
> What does "normal" mean?
>
> Is the problem simply the number of significant digits that are displayed?

By normal I am reffering to "levels".

The data that is in logs, shows up as if it has been divided by 10000.

If those values are multiplied by 10000 I get the "real" values.

Subject: Importing from Excel

From: dpb

Date: 9 Aug, 2013 21:37:48

Message: 5 of 5

On 8/9/2013 3:23 PM, Mercu Vestergaard wrote:
> "someone" wrote in message <ku3foh$9oc$1@newscl01ah.mathworks.com>...
...

>> What values are expecting - if not 0.0001?
>>
>> What does "normal" mean?
>>
>> Is the problem simply the number of significant digits that are
>> displayed?
>
> By normal I am reffering to "levels".
>
> The data that is in logs, shows up as if it has been divided by 10000.
> If those values are multiplied by 10000 I get the "real" values.

I'm betting it's the output display at the command line wherein Matlab
scales the output values of an array to show the mantissa. Cut 'n
paste a little of the data from the command window if that's still
confusing or check if there isn't a header multiplier like the following--

 >> >> Z
Z =
    1.0e+04 *
     0.0001 8.4954
     0.0001 9.4545
     0.0000 9.7965
     0.0001 7.7361
 >>

NB: the first column of Z is much smaller than that of the second (as
would easily be the case w/ a log() variable in comparison to another
that wasn't in log scale) so Matlab has multiplied the values by 1E4 to
be able to show something other than '0' in the first column w/ the

format short

option in effect. Rest assured the whole precision of the value is
present and the value has it's "real" magnitude. To see this try
something like--

 >> Z(1)
ans =
     0.8147

or

 >> format long g
 >> Z
Z =
          0.814723686393179 84953.8361328343
          0.905791937075619 94545.1626267899
          0.126986816293506 97964.5712602722
          0.913375856139019 77360.7764981902
 >>

--

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