Characters and encoding, MATLAB Programming

Characters and Encoding:

A character in a MATLAB is represented by using single quotes (example, 'a' or 'x'). The quotes are essential to denote a character; without them, the letter would be interpreted as the variable name. The Characters are place in an order using what is termed as a character encoding. In character encoding, all characters in the computer's character set are placed in a sequence and given equal integer values. The character set involves all letters of the alphabet, punctuation marks, digits, and more; mainly, all the keys on a keyboard are characters. Special characters like the Enter key are also included. Therefore, 'x', '!', and '3' are all characters. With the quotes, '3' is a character, not a number. The most general character encoding is the American Standard Code for Information Interchange, or ASCII. The standard ASCII has 128 characters that have equivalent integer values from 0 to 127. The first 32 (i.e.integer values 0 through 31) are nonprinting characters. The letters of the alphabet is in order that means 'a' comes before 'b, then c,' and so on.

The numeric functions can be used to convert a character to its equal numeric value (example, double will convert to the double value; int32 will convert to an integer value using the 32 bits, etc.). For illustration, to convert the character 'a' to its numeric equivalent, the statement below could be used:

>> numequiv = double('a')

numequiv =

97

This stores the double value 97 in the variable numequiv that shows that the character 'a' is the ninety-eighth character in the character encoding (as the equivalent numbers start at 0). It doesn't matter which number type is used to convert 'a', for illustration,

>> numequiv = int32('a')

would also store the integer value 97 in the variable numequiv. The only dissimilarity between these will be the type of the resulting variable (double in the first case, int32 in the second case).

Posted Date: 10/18/2012 4:06:47 AM | Location : United States







Related Discussions:- Characters and encoding, Assignment Help, Ask Question on Characters and encoding, Get Answer, Expert's Help, Characters and encoding Discussions

Write discussion on Characters and encoding
Your posts are moderated
Related Questions
The circuit diagram of an active filter is shown below. (a) Determine an expression for the transfer function of the filter. (b) Hence find an expression for the frequency res


A 12-point sequence is x (n) defined as x(n) = { 1, 2, 3, 4, 5, 6, 6, 5, 4, 3, 2, 1}. Write MATLAB programs to (a) Determine the DFT X (k) of x(n) and plot (using stem function)

cAN Can I learn Metlab .I am X Scientist in DigitalCommunication. Can U please help me.I know the programming concepts

Script - MATLAB: The script is a series of MATLAB instructions which is stored in a file and saved. The contents of a script can be showed in the Command Window by using the t

The pressure radiated by a column of in-phase monopole sources may be expressed as: Create a model (spreadsheet / MATLAB etc) for a 6 element column, where d=0.2m . Figure

Statement of Problem I need to realise vector-array multiplication in Simulink. This has been realised in Matlab but because the process yielding the received signal is in Simu

I want to write a function in matlab which gives me a population pyramid bar chart. could you please help me do this.

I have couple questions in MATLAB I need help in

The natural frequencies of a fixed-fixed uniform shaft made of homogeneous material undergoing longitudinal vibration is given by rad/s, where L is the length of the bar, G is th