File Exchange

image thumbnail

num2ascii

version 1.0.2 (1.73 KB) by Curtis
Converts a number into an array of ASCII values compatible with code generation. %#codegen

1 Download

Updated 19 Jul 2018

View Version History

View License

The function was created for use with a serial LCD like the Parallax LCD 27977 or Adafruit LCD 782 and a serial port or text base data format like JSON or XML. This function is useful in code generation environments like Simulink Real-Time and Embedded Coder.

The number of integer digits and decimal digits can be specified with zero padding.

This function fills the gap since the built-in num2str function does not support code generation.

Cite As

Curtis (2021). num2ascii (https://www.mathworks.com/matlabcentral/fileexchange/46815-num2ascii), MATLAB Central File Exchange. Retrieved .

Comments and Ratings (3)

Marco Schürrle

ye yang

bradlc

pretty simple, number input set of ASCII encoded digits output.

Works with Arduino over serial to an LCD that supports ASCII inputs.

MATLAB Release Compatibility
Created with R2012b
Compatible with any release
Platform Compatibility
Windows macOS Linux

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!