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:
How to convert a variable type from double to integer?

Subject: How to convert a variable type from double to integer?

From: Christine

Date: 26 Apr, 2009 04:01:21

Message: 1 of 4

pls help.

Subject: How to convert a variable type from double to integer?

From: Gustavo Morales

Date: 26 Apr, 2009 04:19:01

Message: 2 of 4

Christine:

-try:
> int64(double_value)

-try: use the help and search int*, to see functions that convert values to integers

Subject: How to convert a variable type from double to integer?

From: Loren Shure

Date: 27 Apr, 2009 17:48:39

Message: 3 of 4

In article <gt0mah$hp8$1@fred.mathworks.com>, christine_gee@hotmail.com
says...
> pls help.
>

Either use cast:
http://www.mathworks.com/access/helpdesk/help/techdoc/ref/cast.html

or call the name of the datatype you want to convert to:

   uint8(myDouble)

--
Loren
http://blogs.mathworks.com/loren

Subject: How to convert a variable type from double to integer?

From: batel.bbe@gmail.com

Date: 27 Jul, 2012 09:35:55

Message: 4 of 4

On Saturday, April 25, 2009 9:19:01 PM UTC-7, Gustavo Morales wrote:
> Christine:
>
> -try:
> > int64(double_value)
>
> -try: use the help and search int*, to see functions that convert values to integers

thanks a lot!!

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