Illustration of empty vectors , MATLAB in Mathematics

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 is assigned to it:

>> vec = 1:5

vec =

          1  2  3  4  5

>> vec(3) = []

vec =

         1  2  4  5

The elements in vector are now numbered 1 through 4.

The Subsets of a vector could also be eliminated; for illustration:

>> vec = 1:8

vec =

1  2  3  4  5  6  7  8

>> vec(2:4) = []

vec =

1  5  6  7  8

 

Posted Date: 10/18/2012 5:35:33 AM | Location : United States







Related Discussions:- Illustration of empty vectors , Assignment Help, Ask Question on Illustration of empty vectors , Get Answer, Expert's Help, Illustration of empty vectors Discussions

Write discussion on Illustration of empty vectors
Your posts are moderated
Related Questions
Strcat function - Concatenation : The strcat function, though, will eliminate the trailing blanks from strings before concatenating. Note that in these illustrations, the trail

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

Changing Dimensions: In addition to transpose operator, the MATLAB has some built-in functions which change the dimensions or configuration of matrices, involving fliplr, resh

Built-in function for Differentiation: The MATLAB has a built-in function, diff that returns the differences between consecutive elements in a vector. For illustration, >>

Function xlsread - file function: The function xlsread will read from the spreadsheet file. For illustration, to read from file just generated: >> ssnums = xlsread('ranexc

Refer the subset of a matrix: It is also possible to refer to the subset of a matrix. For illustration, this refers to the first & second rows, second & third columns: >> m

Print an imaginary number: To print an imaginary number, the function disp will show both parts automatically: >> disp(z1)    4.0000 + 2.0000i The function fprint

User input in the while loop: Here is an illustration of running this script: >> readonenum Enter a positive number: -5 Invalid! Enter a positive number: -2.2

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

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