Demo entry 6646095

matlab_lab2.1

   

Submitted by anonymous on Oct 14, 2017 at 08:31
Language: Matlab. Code size: 334 Bytes.

%lab2 demo1%
%清屏
clc
%直接输入
a = [1 2 3; 4 5 6; 7 8 9]
%from:step:to
a = [1:3; 4:6;7:9]
%linspace
a = [linspace(1,3,3);linspace(4,6,3);linspace(7,9,3)]
%ones函数
a = ones(3)
%切片
a(1,:)=[1 2 3]
a(2,:) = [ 4 5 6]
%单下标
b = a(3:6)
b(1)=[]
%test1
c = a(4:6)
c = a(:2)
%test2 logspace
help logspace
logspace(0, 4*pi, 20)

This snippet took 0.00 seconds to highlight.

Back to the Entry List or Home.

Delete this entry (admin only).