Discover MakerZone

MATLAB and Simulink resources for Arduino, LEGO, and Raspberry Pi

Learn more

Discover what MATLAB® can do for your career.

Opportunities for recent engineering grads.

Apply Today

Thread Subject:
Mathlab Excersise

Subject: Mathlab Excersise

From: Sidi Banga

Date: 2 Dec, 2010 09:06:04

Message: 1 of 13

Hello,

Im pretty new to Matlab and i was stuck on a Formula!
Keep getting error messages, 'Inner matrix dimensions must agree.'
The formula is: y=e^-(R/2)t Sin(w*t)
Could anyone please help.

Subject: Mathlab Excersise

From: ImageAnalyst

Date: 2 Dec, 2010 11:40:50

Message: 2 of 13

On Dec 2, 4:06 am, "Sidi Banga" <lt-p...@hotmail.com> wrote:
> Hello,
>
> Im pretty new to Matlab and i was stuck on a Formula!
> Keep getting error messages, 'Inner matrix dimensions must agree.'
> The formula is: y=e^-(R/2)t Sin(w*t)
> Could anyone please help.
----------------------------------------------------------------------
Try using dots before the mathematical operators, something like

y=e .^ -(R/2) .* t .* Sin(w .* t)

Subject: Mathlab Excersise

From: Loren Shure

Date: 2 Dec, 2010 14:23:07

Message: 3 of 13


"Sidi Banga" <lt-pl0x@hotmail.com> wrote in message
news:id7nhs$hi7$1@fred.mathworks.com...
> Hello,
>
> Im pretty new to Matlab and i was stuck on a Formula!
> Keep getting error messages, 'Inner matrix dimensions must agree.'
> The formula is: y=e^-(R/2)t Sin(w*t)
> Could anyone please help.

You need to use the MATLAB names for the functions: e->exp, Sin->sin, and
you might need to use *, .* and .^

--
Loren
http://blogs.mathworks.com/loren/
http://www.mathworks.com/matlabcentral/newsreader/search_results?search_string=tag%3Afaq

Subject: Mathlab Excersise

From: Sidi Banga

Date: 2 Dec, 2010 16:22:04

Message: 4 of 13

ImageAnalyst <imageanalyst@mailinator.com> wrote in message <acd7d4b1-b303-4c0d-b536-39d7f4e1980d@p7g2000prb.googlegroups.com>...
> On Dec 2, 4:06 am, "Sidi Banga" <lt-p...@hotmail.com> wrote:
> > Hello,
> >
> > Im pretty new to Matlab and i was stuck on a Formula!
> > Keep getting error messages, 'Inner matrix dimensions must agree.'
> > The formula is: y=e^-(R/2)t Sin(w*t)
> > Could anyone please help.
> ----------------------------------------------------------------------
> Try using dots before the mathematical operators, something like
>
> y=e .^ -(R/2) .* t .* Sin(w .* t)

I have tried it but this shows up:

>> y=exp .^ -(R/2) .* t .* Sin(w .* t)
??? Error using ==> exp
Not enough input arguments.

Subject: Mathlab Excersise

From: Sean de

Date: 2 Dec, 2010 16:37:04

Message: 5 of 13

"Sidi Banga" <lt-pl0x@hotmail.com> wrote in message <id8h3c$r3$1@fred.mathworks.com>...
> ImageAnalyst <imageanalyst@mailinator.com> wrote in message <acd7d4b1-b303-4c0d-b536-39d7f4e1980d@p7g2000prb.googlegroups.com>...
> > On Dec 2, 4:06 am, "Sidi Banga" <lt-p...@hotmail.com> wrote:
> > > Hello,
> > >
> > > Im pretty new to Matlab and i was stuck on a Formula!
> > > Keep getting error messages, 'Inner matrix dimensions must agree.'
> > > The formula is: y=e^-(R/2)t Sin(w*t)
> > > Could anyone please help.
> > ----------------------------------------------------------------------
> > Try using dots before the mathematical operators, something like
> >
> > y=e .^ -(R/2) .* t .* Sin(w .* t)
>
> I have tried it but this shows up:
>
> >> y=exp .^ -(R/2) .* t .* Sin(w .* t)
> ??? Error using ==> exp
> Not enough input arguments.

exp(-R/2).*t.*sin(w.*t)

Subject: Mathlab Excersise

From: Sidi Banga

Date: 2 Dec, 2010 17:01:05

Message: 6 of 13

"Sean de " <sean.dewolski@nospamplease.umit.maine.edu> wrote in message <id8hvg$sgg$1@fred.mathworks.com>...
> "Sidi Banga" <lt-pl0x@hotmail.com> wrote in message <id8h3c$r3$1@fred.mathworks.com>...
> > ImageAnalyst <imageanalyst@mailinator.com> wrote in message <acd7d4b1-b303-4c0d-b536-39d7f4e1980d@p7g2000prb.googlegroups.com>...
> > > On Dec 2, 4:06 am, "Sidi Banga" <lt-p...@hotmail.com> wrote:
> > > > Hello,
> > > >
> > > > Im pretty new to Matlab and i was stuck on a Formula!
> > > > Keep getting error messages, 'Inner matrix dimensions must agree.'
> > > > The formula is: y=e^-(R/2)t Sin(w*t)
> > > > Could anyone please help.
> > > ----------------------------------------------------------------------
> > > Try using dots before the mathematical operators, something like
> > >
> > > y=e .^ -(R/2) .* t .* Sin(w .* t)
> >
> > I have tried it but this shows up:
> >
> > >> y=exp .^ -(R/2) .* t .* Sin(w .* t)
> > ??? Error using ==> exp
> > Not enough input arguments.
>
> exp(-R/2).*t.*sin(w.*t)

y=exp(-R/2).*t.*sin(W.*t);
??? Error using ==> times
Matrix dimensions must agree.

Subject: Mathlab Excersise

From: Sidi Banga

Date: 2 Dec, 2010 17:06:08

Message: 7 of 13

"Loren Shure" <loren.shure@mathworks.com> wrote in message <id8a4b$hs2$1@fred.mathworks.com>...
>
> "Sidi Banga" <lt-pl0x@hotmail.com> wrote in message
> news:id7nhs$hi7$1@fred.mathworks.com...
> > Hello,
> >
> > Im pretty new to Matlab and i was stuck on a Formula!
> > Keep getting error messages, 'Inner matrix dimensions must agree.'
> > The formula is: y=e^-(R/2)t Sin(w*t)
> > Could anyone please help.
>
> You need to use the MATLAB names for the functions: e->exp, Sin->sin, and
> you might need to use *, .* and .^
>
> --
> Loren
> http://blogs.mathworks.com/loren/
> http://www.mathworks.com/matlabcentral/newsreader/search_results?search_string=tag%3Afaq

y=exp(-R/2).*t'.*sin(W.*t');
??? Error using ==> times
Matrix dimensions must agree.

Subject: Mathlab Excersise

From: Steven_Lord

Date: 2 Dec, 2010 18:11:22

Message: 8 of 13



"Sidi Banga" <lt-pl0x@hotmail.com> wrote in message
news:id8jch$5nd$1@fred.mathworks.com...
> "Sean de " <sean.dewolski@nospamplease.umit.maine.edu> wrote in message
> <id8hvg$sgg$1@fred.mathworks.com>...
>> "Sidi Banga" <lt-pl0x@hotmail.com> wrote in message
>> <id8h3c$r3$1@fred.mathworks.com>...
>> > ImageAnalyst <imageanalyst@mailinator.com> wrote in message
>> > <acd7d4b1-b303-4c0d-b536-39d7f4e1980d@p7g2000prb.googlegroups.com>...
>> > > On Dec 2, 4:06 am, "Sidi Banga" <lt-p...@hotmail.com> wrote:

*snip*

> y=exp(-R/2).*t.*sin(W.*t);
> ??? Error using ==> times
> Matrix dimensions must agree.

You need to show the group the sizes of R, t, and W. You can do this using
the WHOS function.

--
Steve Lord
slord@mathworks.com
comp.soft-sys.matlab (CSSM) FAQ: http://matlab.wikia.com/wiki/FAQ
To contact Technical Support use the Contact Us link on
http://www.mathworks.com

Subject: Mathlab Excersise

From: Sidi Banga

Date: 2 Dec, 2010 18:26:05

Message: 9 of 13

"Steven_Lord" <slord@mathworks.com> wrote in message <id8ng9$3cm$1@fred.mathworks.com>...
>
>
> "Sidi Banga" <lt-pl0x@hotmail.com> wrote in message
> news:id8jch$5nd$1@fred.mathworks.com...
> > "Sean de " <sean.dewolski@nospamplease.umit.maine.edu> wrote in message
> > <id8hvg$sgg$1@fred.mathworks.com>...
> >> "Sidi Banga" <lt-pl0x@hotmail.com> wrote in message
> >> <id8h3c$r3$1@fred.mathworks.com>...
> >> > ImageAnalyst <imageanalyst@mailinator.com> wrote in message
> >> > <acd7d4b1-b303-4c0d-b536-39d7f4e1980d@p7g2000prb.googlegroups.com>...
> >> > > On Dec 2, 4:06 am, "Sidi Banga" <lt-p...@hotmail.com> wrote:
>
> *snip*
>
> > y=exp(-R/2).*t.*sin(W.*t);
> > ??? Error using ==> times
> > Matrix dimensions must agree.
>
> You need to show the group the sizes of R, t, and W. You can do this using
> the WHOS function.
>
> --
> Steve Lord
> slord@mathworks.com
> comp.soft-sys.matlab (CSSM) FAQ: http://matlab.wikia.com/wiki/FAQ
> To contact Technical Support use the Contact Us link on
> http://www.mathworks.com

I'm new to matlab :/ How can i use the WHOS function?

Subject: Mathlab Excersise

From: Sean de

Date: 2 Dec, 2010 18:34:07

Message: 10 of 13

"Sidi Banga" <lt-pl0x@hotmail.com> wrote in message <id8obt$6e$1@fred.mathworks.com>...
> "Steven_Lord" <slord@mathworks.com> wrote in message <id8ng9$3cm$1@fred.mathworks.com>...
> >
> >
> > "Sidi Banga" <lt-pl0x@hotmail.com> wrote in message
> > news:id8jch$5nd$1@fred.mathworks.com...
> > > "Sean de " <sean.dewolski@nospamplease.umit.maine.edu> wrote in message
> > > <id8hvg$sgg$1@fred.mathworks.com>...
> > >> "Sidi Banga" <lt-pl0x@hotmail.com> wrote in message
> > >> <id8h3c$r3$1@fred.mathworks.com>...
> > >> > ImageAnalyst <imageanalyst@mailinator.com> wrote in message
> > >> > <acd7d4b1-b303-4c0d-b536-39d7f4e1980d@p7g2000prb.googlegroups.com>...
> > >> > > On Dec 2, 4:06 am, "Sidi Banga" <lt-p...@hotmail.com> wrote:
> >
> > *snip*
> >
> > > y=exp(-R/2).*t.*sin(W.*t);
> > > ??? Error using ==> times
> > > Matrix dimensions must agree.
> >
> > You need to show the group the sizes of R, t, and W. You can do this using
> > the WHOS function.
> >
> > --
> > Steve Lord
> > slord@mathworks.com
> > comp.soft-sys.matlab (CSSM) FAQ: http://matlab.wikia.com/wiki/FAQ
> > To contact Technical Support use the Contact Us link on
> > http://www.mathworks.com
>
> I'm new to matlab :/ How can i use the WHOS function?
type:
whos
at the command line...

Subject: Mathlab Excersise

From: Sidi Banga

Date: 2 Dec, 2010 18:55:08

Message: 11 of 13

"Sean de " <sean.dewolski@nospamplease.umit.maine.edu> wrote in message <id8oqv$12o$1@fred.mathworks.com>...
> "Sidi Banga" <lt-pl0x@hotmail.com> wrote in message <id8obt$6e$1@fred.mathworks.com>...
> > "Steven_Lord" <slord@mathworks.com> wrote in message <id8ng9$3cm$1@fred.mathworks.com>...
> > >
> > >
> > > "Sidi Banga" <lt-pl0x@hotmail.com> wrote in message
> > > news:id8jch$5nd$1@fred.mathworks.com...
> > > > "Sean de " <sean.dewolski@nospamplease.umit.maine.edu> wrote in message
> > > > <id8hvg$sgg$1@fred.mathworks.com>...
> > > >> "Sidi Banga" <lt-pl0x@hotmail.com> wrote in message
> > > >> <id8h3c$r3$1@fred.mathworks.com>...
> > > >> > ImageAnalyst <imageanalyst@mailinator.com> wrote in message
> > > >> > <acd7d4b1-b303-4c0d-b536-39d7f4e1980d@p7g2000prb.googlegroups.com>...
> > > >> > > On Dec 2, 4:06 am, "Sidi Banga" <lt-p...@hotmail.com> wrote:
> > >
> > > *snip*
> > >
> > > > y=exp(-R/2).*t.*sin(W.*t);
> > > > ??? Error using ==> times
> > > > Matrix dimensions must agree.
> > >
> > > You need to show the group the sizes of R, t, and W. You can do this using
> > > the WHOS function.
> > >
> > > --
> > > Steve Lord
> > > slord@mathworks.com
> > > comp.soft-sys.matlab (CSSM) FAQ: http://matlab.wikia.com/wiki/FAQ
> > > To contact Technical Support use the Contact Us link on
> > > http://www.mathworks.com
> >
> > I'm new to matlab :/ How can i use the WHOS function?
> type:
> whos
> at the command line...


>> whos
  Name Size Bytes Class Attributes

  R 1x5 40 double
  W 1x5 40 double
  e 1x1 8 double
  k 1x1 8 double
  t 1x101 808 double


 y=expm(-R/2).*t'.*sin(W.*t');
??? Error using ==> mtimes
Inner matrix dimensions must agree.

Error in ==> expm>PadeApproximantOfDegree at 118
                A2 = A*A; A4 = A2*A2; A6 = A2*A4;

Error in ==> expm at 30
            F = PadeApproximantOfDegree(m_vals(i));

Subject: Mathlab Excersise

From: ImageAnalyst

Date: 2 Dec, 2010 19:05:35

Message: 12 of 13

In this part:
W.*t'
you're multiplying a 1 by 5 matrix element for element times a 101 by
1 matrix.
Exactly what do you think this should do?
Does that make sense to you? Because it doesn't to me.
Even if the orientations were the same, you can't multiply 5 elements
by 101.

Subject: Mathlab Excersise

From: Sidi Banga

Date: 2 Dec, 2010 19:24:05

Message: 13 of 13

ImageAnalyst <imageanalyst@mailinator.com> wrote in message <15c786e6-10de-4a24-802a-73a54070cfa3@29g2000prb.googlegroups.com>...
> In this part:
> W.*t'
> you're multiplying a 1 by 5 matrix element for element times a 101 by
> 1 matrix.
> Exactly what do you think this should do?
> Does that make sense to you? Because it doesn't to me.
> Even if the orientations were the same, you can't multiply 5 elements
> by 101.

Like i said i'm new to this! Matrixes and Matlab..

Tags for this Thread

No tags are associated with this thread.

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.

Contact us