Illustration of logical vectors, MATLAB in Mathematics

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 were greater than 5.

>> notlog = testvecgtn(vec,5)

notlog =

0        1  0  0  1  1

>> sum(notlog)

ans =

  3

Though, as before, it could not be used to index a vector as the elements are double, and not logical:

>> vec(notlog)

??? Subscript indices should either be real positive integers or logical.

 

 

 

Posted Date: 10/19/2012 5:53:26 AM | Location : United States







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

Write discussion on Illustration of logical vectors
Your posts are moderated
Related Questions
Differentiation: The derivative of a function y = f(x) can be written as follows or f  '(x) and is defined as the rate of change of the dependent variable y with respe

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

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

Structure Consisting of the Fields A MATLAB can also solve the sets of equations. In this illustration, the solutions for x, y, & z are returned as a structure consisting of th

Logical Vectors: The relational operators can also be used with the vectors and matrices. For illustration, let's say that there is a vector, and we want to compare each eleme

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

Strcat function - Concatenation : The strcat function, though, will eliminate the trailing blanks from strings before concatenating. Note that in these illustrations, the trail

Use of string variables: The Characters involve letters of the alphabet, punctuation marks, digits, white space, and control characters. The Control characters are characters

Give the formula for a rational function that has a hole at x=7 & vertical asmptote at x=-3/2

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