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
Program of built-in factorial function: Calling this function yields similar result as the built-in factorial function: >> fact(5) ans =   120 >> factorial(

Illustration of Logical vectors: Calling the function appears to return similar vector as simply vec > 5, and summing the result still works to determine how many elements wer

sprintf function: The sprintf function works precisely like the fprintf function, but rather than printing it generates a string. Here are some illustrations in which the outp

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

Write a MATLAB function [d1, u1, l1, c1, r1] = NaiveGaussArrow(d, u, l, c, r) that takes as input the 5 vectors de ned above representing A. This function performs Naive Gauss redu

Example of Recursive functions: This definition is recursive as a factorial is defined in terms of the other factorial. There are two parts to any recursive definition: the co

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

Built in recursive function in MATLAB: We have seen that the built-in function in MATLAB to compute factorials, termed as the factorial and we know how to implement the iterat

How do I write a product series running from i to n of x''s using a for loop?