Solved

dot calculation

Posted on 2007-04-09
2
594 Views
Last Modified: 2016-02-10
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
Comment
Question by:rmtogether
  • 2
2 Comments
 
LVL 4

Expert Comment

by:MacroLand
Comment Utility
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

by:
MacroLand earned 500 total points
Comment Utility
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

Free Trending Threat Insights Every Day

Enhance your security with threat intelligence from the web. Get trending threat insights on hackers, exploits, and suspicious IP addresses delivered to your inbox with our free Cyber Daily.

Join & Write a Comment

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 …

771 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

14 Experts available now in Live!

Get 1:1 Help Now