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:
conversion from double to char

Subject: conversion from double to char

From: Timothy Koh

Date: 11 Mar, 2013 07:35:11

Message: 1 of 3

Hi

Anyone know how to convert 1 1 1 0 0 0 <1x6 double> to 111000 <1x6 char>?

Regards
Timothy

Subject: conversion from double to char

From: James Tursa

Date: 11 Mar, 2013 07:57:12

Message: 2 of 3

"Timothy Koh" <timothy_koh87@hotmail.com> wrote in message <khk1ff$eur$1@newscl01ah.mathworks.com>...
> Hi
>
> Anyone know how to convert 1 1 1 0 0 0 <1x6 double> to 111000 <1x6 char>?

d = [1 1 1 0 0 0];
c = char(d+'0');

James Tursa

Subject: conversion from double to char

From: Timothy Koh

Date: 11 Mar, 2013 10:23:05

Message: 3 of 3

"James Tursa" wrote in message <khk2oo$i49$1@newscl01ah.mathworks.com>...
> "Timothy Koh" <timothy_koh87@hotmail.com> wrote in message <khk1ff$eur$1@newscl01ah.mathworks.com>...
> > Hi
> >
> > Anyone know how to convert 1 1 1 0 0 0 <1x6 double> to 111000 <1x6 char>?
>
> d = [1 1 1 0 0 0];
> c = char(d+'0');
>
> James Tursa

Thanks for your help James Tursa

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