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
Function issorted - set operations: The function issorted will return 1 for logical true when the argument is sorted in ascending order (minimum to maximum), or 0 for false wh

Storing Strings in Cell Arrays: The one good application of a cell array is to store strings of various lengths. As cell arrays can store various types of values in the elemen

Use of While loop: Here is an illustration of calling the function, passing 5000 for the value of the input argument high. >> factgthigh(5000) ans = 5040 The itera

Gauss-Jordan: The Gauss-Jordan elimination technique begins in similar way which the Gauss elimination technique does, but then rather than of back-substitution, the eliminati

function numden: The function numden will return individually the numerator & denominator of a symbolic expression: >> sym(1/3 + 1/2) ans = 5/6 >> [n, d] =

Passing arguments to functions: In all these functions examples faraway, at least one of the arguments was passed in the function call to be the value(s) of the equivalent inp

Example of modular program: In a modular program, there would be one main script which calls three separate functions to complete these tasks: A function to prompt an us

Implementation of binary search: The binary search can be implemented as a recursive function. The recursive function below also implements this binary search algorithm. It re

Function cellplot - Cell array: The function cellplot place a graphical display of the cell array in a figure Window; though, it is a high-level view and fundamentally just di