Next Post:

Creating Helical Patterns In Siemens NX(Illustrated Expression)

Calculation Of Absolute Values Of Numbers, Vectors And Matrices In MatLab(Illustrated Expression)


There are lots of kinds of mathematical functions in Matlab. These mathematical functions can be very useful when they used properly in Matlan codes. In this article we will basically explain how to calculate the absolute values of variables such as integers, vectors and matrices in Matlab.

How To Use ‘abs()’ Code To Calculate Absolute Values In Matlab?

The use of abs() command in Matlab.

We basically created variables as ‘a’, ‘b’ and ‘c’ that are respectively matrix, vector and integer as shown by red box above in Matlab. Also we respectively calculated their absolute values by typing them inside the paranthesis of abs() command as shown by green box. As you understande that the ‘a’ matrix all element’s absolute values are calculated individually as shown by red arrow above.

Also this is valid for the absolute value calculation of vectors as shown by blue arrow. The whole elements of the vector ‘b’ absolute values are calculated individually. Also sing value of ‘c’ directly calculated as absolute with abs() command as shown by orange arrow in Matlab.

We multiplied the absolute values of integer ‘c’ and matrix ‘a’ as shown by green arrow above. The multiplication is done element by element as you see with magenta arrow above.

So the logic is very basic.

Leave your comments and questions below!

  • Site Comments

At least 10 characters required.