Deblank function, MATLAB in Engineering

deblank function:

The deblank function eliminates only trailing blanks from the string, not leading the blanks. The strtrim function will eliminate both the leading and trailing blanks from a string, but not blanks in a middle of the string. In the illustration below, the three blanks in the starting and four blanks in the end are eliminated, but not the two blanks in the middle. Choosing the result in MATLAB with the mouse would show the blank spaces.

 >> strvar = [blanks(3) 'xx' blanks(2) 'yy' blanks(4)]

strvar =

   xx  yy

>> length(strvar)

ans =

13

>> strtrim(strvar)

ans =

xx  yy

>> length(ans)

ans =

6

Posted Date: 10/20/2012 5:25:15 AM | Location : United States







Related Discussions:- Deblank function, Assignment Help, Ask Question on Deblank function, Get Answer, Expert's Help, Deblank function Discussions

Write discussion on Deblank function
Your posts are moderated
Related Questions
Set Operations: The MATLAB has numerous built-in functions which perform set operations on vectors. These involve intersect, union, setdiff, unique, and setxor. All these func

Reading from a Mat-File: The load function is used to read from various types of files. As with save function, by default the file will be supposed to be a MAT-file, and load

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

function imread: The function imread can read an image file, for illustration a JPEG (.jpg) file. The function reads color images into a 3-dimensional matrix. >> myimage1

Calling of Function polyval: The curve does not appear very smooth on this plot, but that is as there are only five points in the x vector. To estimate the temperature

Example to change the line width from the default: For illustration, to change the line width from the default of 0.5 to 1.5: >> set(hl,'LineWidth',1.5) As long as the


Forward substitution: The Forward substitution (done methodically by first getting a 0 in the a 21 place, and then a 31 , and lastly a 32 ): For the Gauss technique,

Reading from a File in a While Loop: Though in most languages the combination of a loop and an if statement would be essential to determine whether or not the elements in a ve

Executing a program: Running the program would be completed by typing the name of the script; this would call the other functions: >> calcandprintarea Whenever prompt