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 =



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
Illustration of Empty vectors: The Empty vectors can also be used to delete elements from the arrays. For illustration, to remove the third element from array, an empty vector

Example of Minimum and Maximum Value For matrices, the functions min and max operate column wise by the default: >> mat = randint(2,4,[1 20]) mat =    9   10   1

Applications of Customized Strings: Labels, Prompts, Arguments to Functions: The one of very useful application of this is to involve numbers in strings that are used to plot

Find Minimum and Maximum for each row To find the maximum (or minimum) for each row, the dimension of 2 (that is how a MATLAB refers to rows) can be identified as the third arg

Animation: In this part we will observe a couple of ways to animate a plot. These are visuals, therefore the outcomes can't really be shown here; it is essential to type these

Nested IF-ELSE statements: The if-else statement is used to select between the two statements. In order to select from more than two statements, the if-else statements can als

Script a MATLAB program which meets the following speci cations: The program expects an input of a two-variable real-valued continuous function f : R^2--> R The program is to cal

Illustration of a recursive function: illustration is of a recursive function which does not return anything, but simply prints. The below function prtwords receives a sentenc

5 p2+8p+15, 3 p2-3p-18, 12 p2-p-30

strvcat function - concatenation: The function strvcat will concatenate it vertically, that means that it will generate a column vector of the strings.   >> strvcat(fir