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 decimal integer to a ternary string?

Subject: how to convert decimal integer to a ternary string?

From: dai

Date: 18 Mar, 2009 03:10:25

Message: 1 of 2

I am coming to a problem that there is a matlab function called DEC2BIN which can convert decimal integer to a binary string. But I am not able to write a function that can convert a decimal integer to a ternary string. Please give me hand.

Subject: how to convert decimal integer to a ternary string?

From: Roger Stafford

Date: 18 Mar, 2009 07:00:08

Message: 2 of 2

"dai " <279711585@qq.com> wrote in message <gppon1$lf6$1@fred.mathworks.com>...
> I am coming to a problem that there is a matlab function called DEC2BIN which can convert decimal integer to a binary string. But I am not able to write a function that can convert a decimal integer to a ternary string. Please give me hand.

  Use matlab's 'dec2base' function.

Roger Stafford

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