正在加载图片...
MATLAB Basics(9/40) Variables and Arrays Initialization using built-in functions √ zeros()ones() √size)length() ·x=zeros(2) y=ones(size(x)) X- y= 00 11 00 11 ·z=ones(2,3) ·t=zeros(length(z)) t= 111 0 0 0 111 0 0 0 0 0 0 LENGTH(X)returns the length of vector X. It is equivalent to MAX(SIZE(X))for non- 同濟大学 TONGJI UNIVERSITY empty arrays and 0 for empty ones. MATLAB Basics(9/40) Variables and Arrays ➢ Initialization using built-in functions ✓ zeros() ones() • x = zeros(2) x = 0 0 0 0 • z = ones(2,3) z = 1 1 1 1 1 1 ✓ size() length() • y = ones(size(x)) y = 1 1 1 1 • t = zeros( length(z) ) t = 0 0 0 0 0 0 0 0 0 LENGTH(X) returns the length of vector X. It is equivalent to MAX(SIZE(X)) for non￾empty arrays and 0 for empty ones
<<向上翻页向下翻页>>
©2008-现在 cucdc.com 高等教育资讯网 版权所有