⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 matrix.m

📁 this file consists of many matlab programs
💻 M
字号:
a=[1 2 3;2 0 3;1 2 0] %%creating matrix%%
b=[2 2 3;2 2 3;2 2 3]
c=a+b                 %%adding matrix%%
sum(a)                %%adding elements of columns%%
sum(b')'              %%adding elements of rows%%
d=b-a                 %%substracting matrix %%
h(1,1)=1              %%creating (h) as identity matrix%%
h(2,2)=1
h(3,3)=1
t=c'*d'               %%multiplying transpose of matrix%%

%% creating matrix with the help of zeros and ones %%
g=zeros(3,4)
j=2*ones(2,4)
k=trace(a) %%adding the diagonals of matrix%%
f=det(a)%%calculating determinant of matrix %%
l=eye(3)              %%identity matrix%%
a1=inv(a)%%calculating inverse of matrix%%
v=diag(a)%%display the diagonal contents%%
%%calculating inverse of matrix with help of operator%%
a3=a^(-1)     %%inverse of a%%
a2=eye(3,3)/a %%inverse of a%%
sq=a2^2    %%square of matrix%%

%%solving algebraic equations with help of matrices%%
%%solving 2x+y=1;x+y=0%%
p=[2 1;1 1]
r=[1;0]
q=p\r  %%x=1 y=-1%%

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -