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 =


>> strtrim(strvar)

ans =

xx  yy

>> length(ans)

ans =


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
Technique is to create one element - vector: Technique is to create one element with the values from one structure, and use repmat to replicate it to the preferred size. Then,

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

Replacement : Replace a row by adding it to (or subtract from it) a multiple of the other row. For a given row ri, this is written as   ri  - srj →  ri Note that when r

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

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

Basic mathematical operations: All the basic mathematical operations can be executed on symbolic expressions and variables (example, add, raise to a power, multiply, subtract,

Converting between the String and Number types: The MATLAB has many functions which convert numbers to strings in which each character element is a separate digit, and vice ve

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

Illustration of Sound files: For illustration, the following script generates a subplot which shows the signals from chirp and from train, which is as shown in figure: