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:
undefined function

Subject: undefined function

From: Snow White

Date: 27 May, 2009 17:37:01

Message: 1 of 6

hi,

I have written the following code:

A=((sin(temp_theeta_incident)^2)*(1+rho)-2*temp_rho/(4*rho)*cos(temp_theeta_incident));
B=((sin(temp_theeta_incident)^2)*(1+rho))/(4*rho*cos(temp_theeta_incident));
C=(-2*(sin(temp_theeta_incident)^2)*(1-rho)+rho)/(4*rho*cos(temp_theeta_incident));

% A^2*(m)^4+(2*A*C-1)*(m)^3+(((2*A*B+C^2+(sin(theeta_incident))^2*m)^2))+((2*B*C*m))+B^2; %%intermediate form
            
D=(sin(theeta_incident(x,y,f_flag))^2);
one=double(A^2);
two=double(2*A*C-1);
three=double(2*A*B+C^2+D);
four=double(2*B*C);
five=double(B^2);
p = [one two three four five];
if (isnan(sum(A(:))) || isnan(sum(B(:))) || isnan(sum(C(:))) || isinf(sum(A(:))) || isinf(sum(B(:))) || isinf(sum(C(:))))
    value_chk=1;
else
    r = roots(p); %%computing roots of the equation inorder to find the refractive index
    [root_size rr]=size(r);
end

and out of now where i started getting the following error

??? Undefined function or method 'mpower' for input arguments of type 'double' and attributes
'full 3d complex'.

Error in ==> refractive_index_estimation_moments at 250
one=double(A^2);

can anyone help me with this?

Bye

Subject: undefined function

From: Steven Lord

Date: 27 May, 2009 17:44:23

Message: 2 of 6


"Snow White" <gulesaman@gmail.com> wrote in message
news:gvjtnt$2jn$1@fred.mathworks.com...
> hi,
>
> I have written the following code:

*snip*

> one=double(A^2);

*snip*

> and out of now where i started getting the following error
>
> ??? Undefined function or method 'mpower' for input arguments of type
> 'double' and attributes
> 'full 3d complex'.
>
> Error in ==> refractive_index_estimation_moments at 250
> one=double(A^2);
>
> can anyone help me with this?

You can't raise a 3D array (A) to a power -- remember that A^2 is
essentially the same as A*A, and as far as I know there's no standard
definition for matrix multiplication on 3D arrays. If you're trying to
raise each element of A to the second power, then use the .^ operator
instead of the ^ operator.

If you don't expect A to be 3D on that line, then you need to work your way
back through your code to determine where it becomes 3D and why.

--
Steve Lord
slord@mathworks.com

Subject: undefined function

From: Snow White

Date: 28 May, 2009 15:45:03

Message: 3 of 6

i tried adding the dot... here is wat i get

??? Error using ==> horzcat
CAT arguments dimensions are not consistent.

Error in ==> refractive_index_estimation_moments at 260
    p = [A.^2 2*A.*C-1 2*A.*B+C.^2+D 2*B.*C B.^2];
wat do i do abt this ?

"Steven Lord" <slord@mathworks.com> wrote in message <gvju58$29$1@fred.mathworks.com>...
>
> "Snow White" <gulesaman@gmail.com> wrote in message
> news:gvjtnt$2jn$1@fred.mathworks.com...
> > hi,
> >
> > I have written the following code:
>
> *snip*
>
> > one=double(A^2);
>
> *snip*
>
> > and out of now where i started getting the following error
> >
> > ??? Undefined function or method 'mpower' for input arguments of type
> > 'double' and attributes
> > 'full 3d complex'.
> >
> > Error in ==> refractive_index_estimation_moments at 250
> > one=double(A^2);
> >
> > can anyone help me with this?
>
> You can't raise a 3D array (A) to a power -- remember that A^2 is
> essentially the same as A*A, and as far as I know there's no standard
> definition for matrix multiplication on 3D arrays. If you're trying to
> raise each element of A to the second power, then use the .^ operator
> instead of the ^ operator.
>
> If you don't expect A to be 3D on that line, then you need to work your way
> back through your code to determine where it becomes 3D and why.
>
> --
> Steve Lord
> slord@mathworks.com
>

Subject: undefined function

From: someone

Date: 28 May, 2009 16:18:01

Message: 4 of 6

"Snow White" <gulesaman@gmail.com> wrote in message <gvmbhv$e2t$1@fred.mathworks.com>...
> i tried adding the dot... here is wat i get
>
> ??? Error using ==> horzcat
> CAT arguments dimensions are not consistent.
>
> Error in ==> refractive_index_estimation_moments at 260
> p = [A.^2 2*A.*C-1 2*A.*B+C.^2+D 2*B.*C B.^2];
> wat do i do abt this ?

Are ALL your arrays the same size?
(They need to be to things like A.*B+C)
As Steven asked before, are they supposed to be 3D?

>
> "Steven Lord" <slord@mathworks.com> wrote in message <gvju58$29$1@fred.mathworks.com>...
> >
> > "Snow White" <gulesaman@gmail.com> wrote in message
> > news:gvjtnt$2jn$1@fred.mathworks.com...
> > > hi,
> > >
> > > I have written the following code:
> >
> > *snip*
> >
> > > one=double(A^2);
> >
> > *snip*
> >
> > > and out of now where i started getting the following error
> > >
> > > ??? Undefined function or method 'mpower' for input arguments of type
> > > 'double' and attributes
> > > 'full 3d complex'.
> > >
> > > Error in ==> refractive_index_estimation_moments at 250
> > > one=double(A^2);
> > >
> > > can anyone help me with this?
> >
> > You can't raise a 3D array (A) to a power -- remember that A^2 is
> > essentially the same as A*A, and as far as I know there's no standard
> > definition for matrix multiplication on 3D arrays. If you're trying to
> > raise each element of A to the second power, then use the .^ operator
> > instead of the ^ operator.
> >
> > If you don't expect A to be 3D on that line, then you need to work your way
> > back through your code to determine where it becomes 3D and why.
> >
> > --
> > Steve Lord
> > slord@mathworks.com
> >

Subject: undefined function

From: padoh

Date: 2 Aug, 2013 05:47:25

Message: 5 of 6

how do we go about performing matrix operations (e.g inverse, multiplication etc) on 3D matrices?









teven Lord" <slord@mathworks.com> wrote in message <gvju58$29$1@fred.mathworks.com>...
>
> "Snow White" <gulesaman@gmail.com> wrote in message
> news:gvjtnt$2jn$1@fred.mathworks.com...
> > hi,
> >
> > I have written the following code:
>
> *snip*
>
> > one=double(A^2);
>
> *snip*
>
> > and out of now where i started getting the following error
> >
> > ??? Undefined function or method 'mpower' for input arguments of type
> > 'double' and attributes
> > 'full 3d complex'.
> >
> > Error in ==> refractive_index_estimation_moments at 250
> > one=double(A^2);
> >
> > can anyone help me with this?
>
> You can't raise a 3D array (A) to a power -- remember that A^2 is
> essentially the same as A*A, and as far as I know there's no standard
> definition for matrix multiplication on 3D arrays. If you're trying to
> raise each element of A to the second power, then use the .^ operator
> instead of the ^ operator.
>
> If you don't expect A to be 3D on that line, then you need to work your way
> back through your code to determine where it becomes 3D and why.
>
> --
> Steve Lord
> slord@mathworks.com
>

Subject: undefined function

From: Nasser M. Abbasi

Date: 2 Aug, 2013 06:13:46

Message: 6 of 6

On 8/2/2013 12:47 AM, padoh wrote:
> how do we go about performing matrix operations (e.g inverse, multiplication etc) on 3D matrices?

How do you define an inverse of a 3D matrix?

Tags for 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