%%
for i=1:100
x=linspace(0,10,101);
plot(x,sin(x+1));
print(gcf,'-deps',strcat('plot',num2str(i),'.ps'));
end
%%
tic
for n=1:2:10
a(n)=2^n
disp(a(n))
end
toc
%%
tic
for ii = 1:2000
for jj = 1:2000
A(ii,jj) = ii + jj;
end
end
toc
%%
tic
A = zeros(2000, 2000);
for ii = 1:size(A,1)
for jj = 1:size(A,2)
A(ii,jj) = ii + jj;
end
end
toc
%%
A=[0,9,-34;-1,-14,49;4,25,64]
A=A'
[x,y]=size(A);
B=zeros(x,y);
for i=1:x
for j=1:y
B(i,j)=A(i,j)
if B(i,j)<0
B(i,j)=-B(i,j)
end
end
end
B
%%
freebody(0,0,10)
cos(10)
cos([1 4 8 90])
freebody([0,0],[1,1],[34,90])
%%华氏度和摄氏度相互转换
H=input('请输入华氏度:')
test(H)
%%虚拟函数
f=@(x) 2*x;
x=1:0.1:10;
plot(x,f(x))
郭彦甫Day1
最新推荐文章于 2024-07-11 15:21:16 发布