# Essentials  (Page 3/4)

 Page 3 / 4

## Declaration of a column vector

Elements of a column vector is ended by a semicolon:

c = [1;2;3;4;5;]

Or by transposing a row vector with the ' operator:

c = [1 2 3 4 5]' Assignment of a column vector quantity by transposing a row vector with the ' operator.

Or by using the Variable Editor: Assignment of a column vector quantity by using the Variable Editor.

## Declaration of a matrix

Matrices are typed in rows first and separated by semicolons to create columns. Consider the examples below:

Let us type in a 2x5 matrix:

d = [2 4 6 8 10; 1 3 5 7 9]

This example is a 5x2 matrix:

## Linear equations

Systems of linear equations are very important in engineering studies. In the course of solving a problem, we often reduce the problem to simultaneous equations from which the results are obtained. As you learned earlier, MATLAB stands for Matrix Laboratory and has features to handle matrices. Using the coefficients of simultaneous linear equations, a matrix can be formed to solve a set of simultaneous equations.

Let's solve the following simultaneous equations:

$x+y=1$
$2x-5y=9$

First, we will create a matrix for the left-hand side of the equation using the coefficients, namely 1 and 1 for the first and 2 and -5 for the second. The matrix looks like this:

$\begin{pmatrix}1 & 1\\ 2 & -5\\ \end{pmatrix}$

The above matrix can be entered in the command window by typing A=[1 1; 2 -5] .

Second, we create a column vector to represent the right-hand side of the equation as follows:

$\begin{pmatrix}1\\ 9\\ \end{pmatrix}$

The above column vector can be entered in the command window by typing B= [1;9] .

To solve the simultaneous equation, we will use the left division operator and issue the following command: C=A\B . These three steps are illustrated below:

>>A=[1 1; 2 -5] A =1 1 2 -5>>B= [1;9] B =1 9>>C=A\B C =2 -1>>

The result C indicating 2 and 1 are the values for x and y , respectively.

## Polynomials

In the preceding section, we briefly learned about how to use MATLAB to solve linear equations. Equally important in engineering problem solving is the application of polynomials. Polynomials are functions that are built by simply adding together (or subtracting) some power functions. (see Wikipedia ).

$ax^{2}+bx+c=0$
$\mathrm{f\left(x\right)}=ax^{2}+bx+c$

The coeffcients of a polynominal are entered as a row vector beginning with the highest power and including the ones that are equal to 0.

Create a row vector for the following function: $y=2x^{4}+3x^{3}+5x^{2}+x+10$

Notice that in this example we have 5 terms in the function and therefore the row vector will contain 5 elements. p=[2 3 5 1 10]

Create a row vector for the following function: $y=3x^{4}+4x^{2}-5$

In this example, coefficients for the terms involving power of 3 and 1 are 0. The row vector still contains 5 elements as in the previous example but this time we will enter two zeros for the coefficients with power of 3 and 1: p=[3 0 4 0 -5] .

## The polyval Function

We can evaluate a polynomial p for a given value of x using the syntax polyval(p,x) where p contains the coefficients of polynomial and x is the given number.

Application of nanotechnology in medicine
what is variations in raman spectra for nanomaterials
I only see partial conversation and what's the question here!
what about nanotechnology for water purification
please someone correct me if I'm wrong but I think one can use nanoparticles, specially silver nanoparticles for water treatment.
Damian
yes that's correct
Professor
I think
Professor
what is the stm
is there industrial application of fullrenes. What is the method to prepare fullrene on large scale.?
Rafiq
industrial application...? mmm I think on the medical side as drug carrier, but you should go deeper on your research, I may be wrong
Damian
How we are making nano material?
what is a peer
What is meant by 'nano scale'?
What is STMs full form?
LITNING
scanning tunneling microscope
Sahil
how nano science is used for hydrophobicity
Santosh
Do u think that Graphene and Fullrene fiber can be used to make Air Plane body structure the lightest and strongest. Rafiq
Rafiq
what is differents between GO and RGO?
Mahi
what is simplest way to understand the applications of nano robots used to detect the cancer affected cell of human body.? How this robot is carried to required site of body cell.? what will be the carrier material and how can be detected that correct delivery of drug is done Rafiq
Rafiq
if virus is killing to make ARTIFICIAL DNA OF GRAPHENE FOR KILLED THE VIRUS .THIS IS OUR ASSUMPTION
Anam
analytical skills graphene is prepared to kill any type viruses .
Anam
what is Nano technology ?
write examples of Nano molecule?
Bob
The nanotechnology is as new science, to scale nanometric
brayan
nanotechnology is the study, desing, synthesis, manipulation and application of materials and functional systems through control of matter at nanoscale
Damian
Is there any normative that regulates the use of silver nanoparticles?
what king of growth are you checking .?
Renato
What fields keep nano created devices from performing or assimulating ? Magnetic fields ? Are do they assimilate ?
why we need to study biomolecules, molecular biology in nanotechnology?
?
Kyle
yes I'm doing my masters in nanotechnology, we are being studying all these domains as well..
why?
what school?
Kyle
biomolecules are e building blocks of every organics and inorganic materials.
Joe
anyone know any internet site where one can find nanotechnology papers?
research.net
kanaga
sciencedirect big data base
Ernesto
Introduction about quantum dots in nanotechnology
hi
Loga
what does nano mean?
nano basically means 10^(-9). nanometer is a unit to measure length.
Bharti
how did you get the value of 2000N.What calculations are needed to arrive at it
Privacy Information Security Software Version 1.1a
Good
Got questions? Join the online conversation and get instant answers! By OpenStax By Madison Christian By Mariah Hauptman By OpenStax By Kevin Amaratunga By By Jonathan Long By Rhodes By Danielrosenberger By Jazzycazz Jackson