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
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

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

Built-in functions for Complex numbers:   We know that in MATLAB both i and j are built-in functions which return √-1 (therefore, they can be thought of as built-in constants).

This project requires you to use the ideas of Chapter 25 regarding maximization of a function. Here we assume that evolution has acted to generate highly efficient foragers. By hig


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

Writing and Reading Spreadsheet Files: The MATLAB functions xlswrite & xlsread will write to and read from the spreadsheet files which have the extension .xls. For illustratio

Counting in a While Loop: Whenever it is not known ahead of the time how many values will be entered into the script, it is often essential to count the number of values which

Program of built-in factorial function: Calling this function yields similar result as the built-in factorial function: >> fact(5) ans =   120 >> factorial(

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