Solved

dot calculation

Posted on 2007-04-09
2
595 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
ID: 18904047
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
ID: 18904066
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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

The purpose of this article is to demonstrate how we can use conditional statements using Python.
Whether you’re a college noob or a soon-to-be pro, these tips are sure to help you in your journey to becoming a programming ninja and stand out from the crowd.
This tutorial explains how to use the VisualVM tool for the Java platform application. This video goes into detail on the Threads, Sampler, and Profiler tabs.
The viewer will learn how to use the return statement in functions in C++. The video will also teach the user how to pass data to a function and have the function return data back for further processing.

911 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

21 Experts available now in Live!

Get 1:1 Help Now