length u=[102030 help length n-length(u LENGTH Length of vector V=[10; 20; 30 401; LENGTH(X) returns the length m=length(v) of vector X. It is equivalent to MAX(SIZE(X)) for non-empty u=5060] arrays and o for empty ones p=length(u)
length • u=[10 20 30]; • n=length(u); • v=[10;20;30;40]; • m=length(v); • u=[50 60]; • p=length(u); help length LENGTH Length of vector. LENGTH(X) returns the length of vector X. It is equivalent to MAX(SIZE(X)) for non-empty arrays and 0 for empty ones
help help who help whos help clear help help help for ° help zeros help help l
help • help who • help whos • help clear • help for • help zeros • help ; • help [] help help
Regular vectors X2024 x-20:229 colon notation X=10:-1:1 X=3:2 <Starting Index> <stride> <Bounding Index>
Regular vectors • x=20:24 • x=20:2:29; • x=10:-1:1 • x=3:2 colon notation <Starting Index>:<stride>:<Bounding Index>
nspace X-linspace(abn xk=a+(-1)*(b-a)(n-1 X-linspaceo, 1,10 00.11110.22220.3333 0.44440.55560.6667 0.77780.88891.0000 Linspace left Endpoint, Right endpoint, Number of Points)
linspace • x=linspace(a,b,n) • xk=a+(k-1)*(b-a)/(n-1) • x=linspace(0,1,10) 0 0.1111 0.2222 0.3333 0.4444 0.5556 0.6667 0.7778 0.8889 1.0000 Linspace(Left Endpoint,Right Endpoint, Number of Points)
logspace x- logspace(2,26)-0100063103981 X=logspace(a, b, n) 2.511915.8489100.0000 10 a+(b-a)(k-1)/(n-1) k=1 9··°9 m=linspace (a, b, n) for kl: n linspace(a, b) linspace(a, b, 100) x(k)=10~m(k) logspace(a, b) logspace(a, b, 50) ent
logspace • x=logspace(-2,2,6) • x=logspace(a,b,n) 0.0100 0.0631 0.3981 2.5119 15.8489 100.0000 m=linspace(a,b,n) for k=1:n x(k)=10^m(k); end x k n a b a k n k 10 , 1,..., ( )( 1)/ ( 1) = = + − − − linspace(a,b) linspace(a,b,100) logspace(a,b) logspace(a,b,50)