Solved

# dot calculation

Posted on 2007-04-09
594 Views
Hi, experts

I am kind of confuse about the syntax in matlab below
p ./ numel(I) --> there is a dot after p
p / numel(I) --> no dot after p

what is the difference between those two? I try couple different p matrix, but I don't see the different in answer.
0
Question by:rmtogether
• 2

LVL 4

Expert Comment

if there is dot between two like A./B then matlab divides the two matrices by their entries like A(i,j)/B(i,j)

if there is no dot between A/B  then matlab takes the inverse of B which is equivalent to A*inv(B)

Regards,
0

LVL 4

Accepted Solution

MacroLand earned 500 total points
Example;

A=[10 12;6 3]

A =

10    12
6     3

>> B=[2 4;3 1]

B =

2     4
3     1

>> C=A./B

C =

5(=10/2)     3(=12/4)
2     3

D=A/B

D =

2.6000    1.6000
0.3000    1.8000

>> D=A*inv(B)

D =

2.6000    1.6000
0.3000    1.8000

Regards,
0

## Featured Post

### Suggested Solutions

If you haven’t already, I encourage you to read the first article (http://www.experts-exchange.com/articles/18680/An-Introduction-to-R-Programming-and-R-Studio.html) in my series to gain a basic foundation of R and R Studio.  You will also find the …
This article will show, step by step, how to integrate R code into a R Sweave document
This theoretical tutorial explains exceptions, reasons for exceptions, different categories of exception and exception hierarchy.
Viewers will learn how to properly install Eclipse with the necessary JDK, and will take a look at an introductory Java program. Download Eclipse installation zip file: Extract files from zip file: Download and install JDK 8: Open Eclipse and …

#### Need Help in Real-Time?

Connect with top rated Experts

14 Experts available now in Live!