In Matlab, we can create different types of vectors where we can perform various operations like addition, subtraction, multiplication, square, square root, power, scaling, vector multiplication, dot product, etc. Output will be 1 1 1 ,that means all values are greater than values of vector n. We can compare a given matrix with any arithmetic constant or with any other vector. Less than operator (): Greater than the operator represents by the symbol ( ‘ > ’). O represents false and 1 represents true.ī. The above statement will give output as 0 1 0, which means first no is not equal, the second number is equal and the third no is not equal. Equal to the operator: this operator compares each n every element from two vectors and gives output is zero and one form.Īs we know there are three elements in vector m and vector n, Suppose I want to find out the square of one particular vector or I want to multiply the vector by that vector only. Syntax: variable name = vector name dot operator multiplication operator vector name Therefore we need to add a dot operator ( ‘. Multiplication of Vectors: If we want to do multiplication of two vectors then a simple multiplication operator ( * ) will not work. Similarly, we can do subtraction operation like sub = p – qĮ. Syntax: vector name operator ( + ) vector name Addition of Vectors: The addition of two or multiple vectors is a simple operation in Matlab, let us consider two vectors p and q. Length: It shows length of particular vector, let us one vector p = ĭ. Syntax: variable name = sum ( vector name )Ĭ. Sum: This shows a total of (addition of ) entire elements in one vector. Syntax: variable name = trigonometric function name ( vector name ) Trigonometric Function: We can apply any trigonometric function on vector-like sin, cos, tan, cosec, sec, etc. Syntax: variable name = arithmetic constant * vector nameī. Multiplication: This function is used to multiply by any arithmetic value to the entire vector. Let us consider two vectors x and y with values x = and y = we can perform various operations on these two vectors x and y.Ī. Vector operators are broadly classified into two categories.
0 Comments
Leave a Reply. |