Thread Subject: usage of " . " in these two equations !!!

Subject: usage of " . " in these two equations !!!

From: Kuo-Hsien

Date: 18 Feb, 2009 03:02:02

Message: 1 of 5

Dear all,
I got the following error message:

??? Error using ==> mrdivide
Out of memory. Type HELP MEMORY for your options.

Error in ==> weather4Elora at 57
ec_sh_06=0.622*ec_es_06/(ec_p_06-0.378*ec_es_06);


However, I thought I probably the equation need to be modified to the following one.
ec_sh_06=(0.622.*ec_es_06)./(ec_p_06-0.378.*ec_es_06);

What is the difference between these two equations? Why do we need to put a " . " behind numbers? Can you guys help me to under this usage?

Thanks,
Michael

Subject: usage of " . " in these two equations !!!

From: Matt Fig

Date: 18 Feb, 2009 03:43:02

Message: 2 of 5

"Kuo-Hsien" <mchangks@hotmail.com> wrote in message
> What is the difference between these two equations? Why do we need to put a " . " behind numbers? Can you guys help me to under this usage?


The dot is read as 'element-by-element' when used like this. Study an easy example if it is still unclear to you.

A = magic(2)
A^2
A*A
A.^2

Now, which one to use in your application will depend on what you are trying to do.




M`Ekbe[W&MOkkakQ\Q9kkr[rTQ1[`kN`UXyMTMYk\NMZT[[SOUX,[QaMMYZ

Subject: usage of " . " in these two equations !!!

From: Greg

Date: 19 Feb, 2009 14:57:02

Message: 3 of 5

"Matt Fig" <spamanon@yahoo.com> wrote in message <gng046$quc$1@fred.mathworks.com>...
> "Kuo-Hsien" <mchangks@hotmail.com> wrote in message
> > What is the difference between these two equations? Why do we need to put a " . " behind numbers? Can you guys help me to under this usage?
>
>
> The dot is read as 'element-by-element' when used like this. Study an easy example if it is still unclear to you.
>
> A = magic(2)
> A^2
> A*A
> A.^2
>
> Now, which one to use in your application will depend on what you are trying to do.
>
>
>
>
> M`Ekbe[W&MOkkakQ\Q9kkr[rTQ1[`kN`UXyMTMYk\NMZT[[SOUX,[QaMMYZ


For more information regarding MATLAB operators, go to the Section titled "Operators" at the following web address:

http://www.mathworks.com/access/helpdesk/help/techdoc/matlab.html

Subject: usage of " . " in these two equations !!!

From: someone

Date: 19 Feb, 2009 16:22:01

Message: 4 of 5

"Kuo-Hsien" <mchangks@hotmail.com> wrote in message <gnftna$jud$1@fred.mathworks.com>...
> Dear all,
> I got the following error message:
>
> ??? Error using ==> mrdivide
> Out of memory. Type HELP MEMORY for your options.
>
> Error in ==> weather4Elora at 57
> ec_sh_06=0.622*ec_es_06/(ec_p_06-0.378*ec_es_06);
>
>
> However, I thought I probably the equation need to be modified to the following one.
> ec_sh_06=(0.622.*ec_es_06)./(ec_p_06-0.378.*ec_es_06);
>
> What is the difference between these two equations? Why do we need to put a " . " behind numbers? Can you guys help me to under this usage?
>
> Thanks,
> Michael

Besides what others have already replied, you don't "need" the dots behind numbers (scalars). But you do "need" them before the slash (divide) in your case above.

Subject: usage of " . " in these two equations !!!

From: Kuo-Hsien

Date: 19 Feb, 2009 16:51:02

Message: 5 of 5

Here is my test as below. By the way, I deeply thank those who advice me in Matlab.

So, I need to put a "." before any divides, not after scalers.
 

>> ec_es_06=[1;2;3;4;5]
>> ec_p_06=[4;5;6;7;8]
>> nodot=0.622*ec_es_06/(ec_p_06-0.378*ec_es_06)

nodot =

         0 0 0 0 0.1018
         0 0 0 0 0.2036
         0 0 0 0 0.3054
         0 0 0 0 0.4072
         0 0 0 0 0.5090
>> number_dot=(0.622.*ec_es_06)./(ec_p_06-0.378.*ec_es_06)

number_dot =

    0.1717
    0.2931
    0.3835
    0.4534
    0.5090

>> divide_dot=(0.622.*ec_es_06)./(ec_p_06-0.378*ec_es_06)

divide_dot =

    0.1717
    0.2931
    0.3835
    0.4534
    0.5090

Tags for this Thread

Add a New Tag:

Separated by commas
Ex.: root locus, bode

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.

rssFeed for this Thread
 

MATLAB Central Terms of Use

NOTICE: Any content you submit to MATLAB Central, including personal information, is not subject to the protections which may be afforded information collected under other sections of The MathWorks, Inc. Web site. You are entirely responsible for all content that you upload, post, e-mail, transmit or otherwise make available via MATLAB Central. The MathWorks does not control the content posted by visitors to MATLAB Central and, does not guarantee the accuracy, integrity, or quality of such content. Under no circumstances will The MathWorks be liable in any way for any content not authored by The MathWorks, or any loss or damage of any kind incurred as a result of the use of any content posted, e-mailed, transmitted or otherwise made available via MATLAB Central. Read the complete Terms prior to use.

Contact us at files@mathworks.com