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
Creating Customized strings: There are many built-in functions which create customized strings, including blanks, char, and sprintf. We know that the char function can be u

Types of User-defined Functions: We know how to write a user-defined function, stored in an M-file, which computes and returns one value. This is merely one type of the functi

Error-checking for integers: illustrations of running this script as shown below: >> readoneint Enter an integer: 9.5 Invalid! Enter an integer: 3.6 Invalid

Illustration of Minimum and Maximum Value Both of these functions also return the index of the minimum or maximum value; when there is more than one occurrence, it returns the

Indexed empty matrix: The Individual elements cannot be eliminated from matrices, as matrices always have the similar number of elements in every row. >> mat = [7 9 8; 4 6

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

how can reconstruct just part of an image using imreconstruct?

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

Symbolic Expression The solve function solves an equation and returns the solution(s) as symbolic expressions. The answer can be converted to numbers by using any numeric funct

Histogram: The histogram is a particular type of bar chart which shows the frequency of occurrence of the values within a vector. The Histograms use what are known as bins to