Removing whitespace characters, MATLAB in Engineering

Removing Whitespace Characters:

The MATLAB has functions which will eliminate trailing blanks from the end of a string and/or leading blanks from the starting of a string.

The deblank function will eliminate blank spaces from end of the string. For illustration, when few strings are padded in a string matrix so that all are of similar length, it is often preferred to then eliminate those extra blank spaces in order to actually use the string.


>> names = char('Sue', 'Cathy','Xavier')

names =




>> name1 = names(1,:)

name1 =


>> length(name1)

ans =


>> name1 = deblank(name1);

>> length(name1)

ans =


Posted Date: 10/20/2012 5:24:35 AM | Location : United States

Related Discussions:- Removing whitespace characters, Assignment Help, Ask Question on Removing whitespace characters, Get Answer, Expert's Help, Removing whitespace characters Discussions

Write discussion on Removing whitespace characters
Your posts are moderated
Related Questions
Algorithm for appex subfunction: The algorithm for appex subfunction is as shown:  Receives x & n as the input arguments.  Initializes a variable for running sum of t

Use of Nested if-else statements: By using the nested if-else to select from among the three possibilities, not all the conditions should be tested. In this situation, if x is

Replacing a string - function strrep: The function strrep finds all the occurrences of a substring within the string, and substitutes them with a new substring. The order of a

Subfunctions: Though, it is possible to have more than one function in a given M-file. For illustration, if one function calls the other, the first function would be the prima

Cross Product: The cross or outer product a × b of two vectors a and b is defined only whenever both a and b are the vectors in three-dimensional space, that means that they b

Referring to and Showing Cell Array Elements and Attributes: Just as with the other vectors, we can refer to individual elements of the cell arrays. The only difference is tha

Creating the structure Variables: Creating a structure variable can be accomplished by simply storing the values in fields by using assignment statements, or by using the stru

. Generate the following signal, x(n)=1+cos((25*pi*n)/100),0 Compute the DTFT of x[n] for w=0:0.01:2*pi Plot the Real part, imaginary part, the amplitude and phas

1. Write a MATLAB function (upperTriangle) using the functions you previously created to convert a matrix to upper triangular form. Start with row 1, column1. Find the row that has

IS Functions for Strings: There are many functions for strings, that return logical true or false. The function isletter returns the logical true when the character is a lette