matlab Flashcards
to know the size of a matrix
size(the name of the variable)
to call out a certain number in the matrix
variable name(row number,column number)
x(3,1)
to call out an entire row in a matrix
using :
x(3,:) is calling out row 3 , nafs l klam m3a l column
dot multiplication between two matrix bytala3 scalar
dot(x,y)
cross product between two vectors
cross(x,y)
the constant e
exp(1)
zero or ONE matrix with diff rows and columns
zeros(rows,columns)
ones(rows,columns)
determinant of a matrix
det(A)
to display a value or a variable
disp(A)
disp(‘ i found it ‘ )
for loop
for i=1:10
ekteb ele anta 3awzo
end
to plot
to enter a title
to label x and y axis
sub plot
plot(x,y)
title(‘A plot of sin x ‘) 3la sbeel el msaal
xlabel(‘time’) ylabel(‘3afreet’)
subplot(2,1,1)
plot m4 3aref eh
subplot(2,1,2)plot 7aga tanya
3adad el steps mabeen value and another value
x=linspace(0,100,200)
hy3ed mn 0 l 100 f 200 step
to plot 2 graphs 2 xs and 2 ys on the same graph
plot(x,y,x,y_2)
plot(x,y,’–‘,x,y_2,’.’)
hyrsem l graph l 2awalany f dashes wel tany f no2at
bar chart
bar(x)
bar(x,y) hyrsemlak bars :D
pie chart
pie(x)
scatter chart used lama l data m4 ordered kwyes
scatter(x,y)