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
Illustration of Variable scope: Running this function does not add any of variables to the workspace, as elaborated: >> clear >> who >> disp(mysum([5 9 1]))

Write a program to examine exponential function: We will write a program to examine the value of e and the exponential function. It will be a menu-driven. The menu options wil

Initializing the data structure - Function: Function is shown as:   >> printcylvols(cyls) Cylinder x has a volume of 169.6 Cylinder a has a volume of 100.5

Example of Menu driven modular program: As an illustration of such a menu-driven program, we will write a program to discover the constant e. The constant e, known as the n

Symbolic Variables and expressions: The MATLAB has a type known as sym for the symbolic variables and expressions; these work with strings. The illustration, to generate a sym

Forward elimination: In forward elimination, we want to obtain a 0 in the a 21 position. To accomplish this, we can alter the second line in the matrix by subtracting from it

Help command: The help command is used with the script rectarea, the function readlenwid, and the major function printrectarea. To see the first comment in the subfunction, as

Application: Menu driven Modular Program Numerous longer, more involved programs which have interaction with the user are menu-driven, that means that the program prints a men

Illustration of Set operations: For illustration, given the vectors as shown below: >> v1 = 2:6 v1 = 2  3  4  5  6 >> v2 = 1:2:7 v2 = 1  3  5  7

Q.1: Consider the transmission of a sinusoid x(t) = cos(2f0t) through a channel a ected by multipath and Doppler. Let there be two paths, and assume the sinusoid is being sent fro