?
Solved

matlab- syntax question

Posted on 2006-04-26
2
Medium Priority
?
126 Views
Last Modified: 2016-02-10
Hi,
   I saw a following matlab code. there is a "." (dot) after "w1". what is the meaning of that dot? I try to remove it, and I don't see any different in the result.

w1=0.5*pi;
td=0:ts:4;
x_sin=sin(w1.*td);
plot (x_sin)
0
Comment
Question by:hsuyf
2 Comments
 
LVL 11

Accepted Solution

by:
dbkruger earned 1000 total points
ID: 16549545
In matlab,* is matrix multiplication.

so:

a=[1 2 3]; % row vector
b = [1;2;3]; % column vector

b*a =
  1  *  *
  *  4  *
  *  *  9

I'm not going to write it out, but you get the picture.

If you just want to multiply the first element of a times b, the second, etc. then use .*

b.*a = [1 4 9]
0
 

Author Comment

by:hsuyf
ID: 16549607
thank you very much!!!
0

Featured Post

VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

Question has a verified solution.

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

Complex Numbers are funny things.  Many people have a basic understanding of them, some a more advanced.  The confusion usually arises when that pesky i (or j for Electrical Engineers) appears and understanding the meaning of a square root of a nega…
This article seeks to propel the full implementation of geothermal power plants in Mexico as a renewable energy source.
Finds all prime numbers in a range requested and places them in a public primes() array. I've demostrated a template size of 30 (2 * 3 * 5) but larger templates can be built such 210  (2 * 3 * 5 * 7) or 2310  (2 * 3 * 5 * 7 * 11). The larger templa…
I've attached the XLSM Excel spreadsheet I used in the video and also text files containing the macros used below. https://filedb.experts-exchange.com/incoming/2017/03_w12/1151775/Permutations.txt https://filedb.experts-exchange.com/incoming/201…
Suggested Courses

830 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