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:
sqrt of 3 dimensional array

Subject: sqrt of 3 dimensional array

From: Mohammad Manirul

Date: 11 May, 2013 00:44:10

Message: 1 of 3

Hi,
I need ur help. I want to get square root of 3 dimensional image. My input dimension is given below:
 
input= 768X1024X3 uint8.

But the error msg shows that " Undefined function or method 'sqrt' for input arguments of type 'uint8'."

PLZ let me know if you have solution.

Subject: sqrt of 3 dimensional array

From: Nasser M. Abbasi

Date: 11 May, 2013 01:19:21

Message: 2 of 3

On 5/10/2013 7:44 PM, Mohammad Manirul wrote:
> Hi,
> I need ur help. I want to get square root of 3 dimensional image. My input dimension is given below:
>
> input= 768X1024X3 uint8.
>
> But the error msg shows that " Undefined function or method 'sqrt' for input arguments of type 'uint8'."
>
> PLZ let me know if you have solution.
>

try to convert the image to data type such as double?


EDU>> x=uint8(8)
EDU>> sqrt(x)
Undefined function 'sqrt' for input arguments of type 'uint8'.
EDU>> sqrt(double(x))

ans =

     2.8284


--Nasser

Subject: sqrt of 3 dimensional array

From: Steven_Lord

Date: 13 May, 2013 03:59:46

Message: 3 of 3



"Mohammad Manirul" <manirul@mathworks.com> wrote in message
news:kmk48q$gbi$1@newscl01ah.mathworks.com...
> Hi,
> I need ur help. I want to get square root of 3 dimensional image. My input
> dimension is given below:
>
> input= 768X1024X3 uint8.
>
> But the error msg shows that " Undefined function or method 'sqrt' for
> input arguments of type 'uint8'."
> PLZ let me know if you have solution.

SQRT is not defined for the integer types, since the square root of an
integer is not necessarily an integer value. You will need to convert it to
one of the floating-point data types (single precision or double precision)
in order to compute the square roots of the elements.

--
Steve Lord
slord@mathworks.com
To contact Technical Support use the Contact Us link on
http://www.mathworks.com

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