Blanks function, MATLAB in Mathematics

Blanks function:

The blanks function will generate a string consisting of n blank characters-that are kind of hard to see here! Though, in a MATLAB if the mouse is moved to highlight the answer in ans, the blanks can be seen.

>> blanks(4)

ans =

>> length(ans)

ans =

4

 

Generally this function is most helpful when concatenating strings and you want a number of blank spaces in between. For illustration, this will insert five blank spaces in between the words:

 

>> [first blanks(5) last]

ans =

Bird     house

 

Showing the transpose of the blanks function can also be used to move the cursor down. In the Command Window, it would appear like this:

>> disp(blanks(4)')

>> 

This is helpful in a script or function to generate space in output, and is basically equivalent to printing the newline character four times.

Posted Date: 10/20/2012 5:07:28 AM | Location : United States







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

Write discussion on Blanks function
Your posts are moderated
Related Questions
Referring to and Modifying the Matrix Elements: To refer to matrix elements, the row and then the column indices are given in parentheses (always the row index initially and t

Error-Checking for Integers: As MATLAB uses the type double by default for all the values, to check to make confirm that the user has entered an integer, the program have to c

Sorting The Sorting is a process of putting a list in order; either in descending (maximum to minimum), or ascending (minimum to maximum) order. For illustration, here is a li

Illustration of Labels and prompts: The program below prompts the user for endpoints (x1, y1) and (x2, y2) of a line segment, and computes the midpoint of the line segment, th

Three-Dimensional Plots: The MATLAB has many functions which will display three-dimensional plots. Most of these functions have similar name as corresponding two-dimensional p

Labels and Prompts: The script loads all the numbers from file into a row vector. It then splits the vector; it stores the initial element that is the experiment number in a v

Strings as Vectors: The Strings are considered as vectors of characters-or in another words, a vector in which each and every element is a single character-so numerous vector

Use of logical vector: Determine how many elements in the vector vec were greater than 5, the sum function can be used on the resulting vector isg: >> sum(isg) ans =

User-defined functions: Therefore, although many functions compute and return values, some do not. A few functions rather merely accomplish a task. Regardless of what type of

Example of Symbolic Expression When there is more than one variable, the MATLAB selects which to solve for. In the illustration below, the equation ax 2 + bx = 0 is solved. Th