removing whitespace charactersthe matlab has


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 =

Sue

Cathy

Xavier

>> name1 = names(1,:)

name1 =

Sue

>> length(name1)

ans =

6

>> name1 = deblank(name1);

>> length(name1)

ans =

3

Request for Solution File

Ask an Expert for Answer!!
Applications of MATLAB: removing whitespace charactersthe matlab has
Reference No:- TGS0175078

Expected delivery within 24 Hours