Thread Subject: Trying to plot a sinc function

Subject: Trying to plot a sinc function

From: Yan Rosh

Date: 15 Dec, 2008 19:38:02

Message: 1 of 4

I have to following problem:

I define a variable t, as such: t = (-12:0.001:12);
and then I try to plot this graph:

y = sinc(t)cos(t);

but then I get an error message (unfortunately I am not in the schools computer lab so I can't tell you the exact error message), it says basically that I can't multiply those matrices because they are not of the same size.

What am I doing wrong here?

Thank you!!!

Subject: Trying to plot a sinc function

From: Roger Stafford

Date: 15 Dec, 2008 19:55:04

Message: 2 of 4

"Yan Rosh" <yan_rosh@yahoo.com> wrote in message <gi6bmq$n69$1@fred.mathworks.com>...
> I have to following problem:
>
> I define a variable t, as such: t = (-12:0.001:12);
> and then I try to plot this graph:
>
> y = sinc(t)cos(t);
>
> but then I get an error message (unfortunately I am not in the schools computer lab so I can't tell you the exact error message), it says basically that I can't multiply those matrices because they are not of the same size.
>
> What am I doing wrong here?
>
> Thank you!!!

  I am guessing you need to add the 'dot' along with the multiplication symbol:

 y = sinc(t).*cos(t);

Roger Staffod

Subject: Trying to plot a sinc function

From: Yan Rosh

Date: 15 Dec, 2008 20:19:02

Message: 3 of 4

"Roger Stafford" <ellieandrogerxyzzy@mindspring.com.invalid> wrote in message <gi6cmo$8mk$1@fred.mathworks.com>...
> "Yan Rosh" <yan_rosh@yahoo.com> wrote in message <gi6bmq$n69$1@fred.mathworks.com>...
> > I have to following problem:
> >
> > I define a variable t, as such: t = (-12:0.001:12);
> > and then I try to plot this graph:
> >
> > y = sinc(t)cos(t);
> >
> > but then I get an error message (unfortunately I am not in the schools computer lab so I can't tell you the exact error message), it says basically that I can't multiply those matrices because they are not of the same size.
> >
> > What am I doing wrong here?
> >
> > Thank you!!!
>
> I am guessing you need to add the 'dot' along with the multiplication symbol:
>
> y = sinc(t).*cos(t);
>
> Roger Staffod


Thanks, ill try it and let you know... :)

Subject: Trying to plot a sinc function

From: chen

Date: 16 Dec, 2008 05:22:30

Message: 4 of 4

This error is because when you write this program in matlab like y=sinc(t)*cos(t) it's means array sinc(t) multiply array cos(t).so you should write like
y=sint(t).*cis(t) in matlab program .

Tags for this Thread

Everyone's Tags:

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.

Tag Activity for This Thread
Tag Applied By Date/Time
sinc Yan Rosh 15 Dec, 2008 14:40:52
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