4.数组与运算-2课时.pptVIP

  • 0
  • 0
  • 约4.52千字
  • 约 36页
  • 2017-08-02 发布于河南
  • 举报
Matlab及其应用;MATLAB 及应用;;数组分类;实例;4.1 数值数组;%This segment demonstrate the creation of 1-D numerical array a=[2 pi/2 sqrt(3) 3+5i] b=0:2:20 c=2:12 d=0:1.5:10 e=linspace(1.1,9.6,12) f=logspace(2,4,11) %This segment demonstrate the access of 1-D numerical array x1=a(3) x2=a(1)/b(3) x3=c([2 4 6]) x4=d(2:6) x5=e(10:-2:1) x6=e(find(e5)) x7=f([1 3 5 7 8 6 4 2]) %This segment demonstrate the assignment of 1-D numerical array x3(2)=0 x4([1 3 5])=[0 0 0] x4([2 4])=0;;%-------Creation of the 2-D array----------- a=3; b=5; c=[1 a a+b*i b;pi sin(pi) b*i i] d=c; e=c(:,1:2)+i*d(1:2,:) narr3; %c

文档评论(0)

1亿VIP精品文档

相关文档