Вы находитесь на странице: 1из 2

command use

-----------------------------------------------------------------------------------
--------------------------------------------------------------
clear all / clear :-it will clear the data base
clc :-screen will be cleaned
clear f :- f will be cleared
e :- power of 10 (ex= 1e3)
exp( ) :- exponational power (e^3)
.* :- element wise *
.\ :- element wise \
'text' :- string

trigonimetry fun :- calculation


( sin(radian), sind(degree) )
inverse of trigon
( asin(radian), asind(degree) )
hyperbolic function
( sinh(radian), sinhd(degree) )
-----------------------------------------------------------------------------------
-------------------
plot(x,y,'line specifiers','marker') :- for plottig only
plot(x,y,'-
mo','Linewidth',2,'markersize',12,'MarkerEdgeColor','g','markerfacecolor','y')
:- creates a plot that connects the points with a magenta
solid line and circles as markers at the points, the line width is 2 points.
subplot(no of row, no of column, no) :- to plot all the graph on same page
figure :- to have more than 1 graph
hold on :- to have two graph in a single graph

-----------------------------------------------------------------------------------
-----------------
ones(rows,column) :- to have a matrix with 1 as all element
zeros(rows,column) or zeros(size) :-sama with 0
eye(size) :- identity matrix
magic(size) :- to have a matrix where adding in any line it's summation
is same
unique(A) :- only show you the number ones in the matrix
setdiff(a,b) :- only show the diff bet 2 matrix
/ :- for div
\ :- inverse

========================================================

sqrt :- for root


log(for base e) or log10:- for log
v=[5 6] :- for making a vector
v' or transpose(v) :- for making transpose
size(v) :- to express the number of row and column
length(v) :- to count the number of element in a single row or
column which ever is max
linspace(s,e,n) :- it will show a list starting with s ending with e
with n number of terms
... :- to continue to nextline of command
diary on :- to record
help file_name :- 1st % line
plot(x,y) :- plotting a graph
file_name :- to run the file
fprintf(' subj %f \n',var) :- to print
%-50.2 :- it will show 2 decimal places
and after the number there will be a space of 50

disp('text') :- to print without any variables

======================================================================
format short :- it will show only 4 digits after decimal
31.4162
format short e :- it will show only 4 digits after decimal with e
3.1415e+01
format long :- it will show only 15 digits after decimal
31.415....... (15 digits)
format long e :- it will show only 15 digits after decimal
3.1415....... e+1(15 digits)
format bank :- it will show only 2 digits after decimal
31.42
format compact :- gap between the line is less
format loose :- gap in between the lines will be more

function use
--------------------
function [name of the outputs ] = name_ofthe_function
(variables_used_for_calculation1) //this all are done in side the function coding
[variables those are return from the function ]= name_ofthe_function
(variables_used_for_calculation2)

Вам также может понравиться