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 3

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 3

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 3

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

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
data type Gustavo Morales 26 Apr, 2009 00:20:04
conversion of d... Christine 26 Apr, 2009 00:05:20
rssFeed for this Thread

Contact us at files@mathworks.com