Octave - Referência Dos Botões
-
Upload
joao-victor-dias -
Category
Documents
-
view
246 -
download
0
Transcript of Octave - Referência Dos Botões
-
8/16/2019 Octave - Referência Dos Botões
1/3
O c t a v e Q u i c k R e f e r e n c e O c t a v e V e r s i o n 1 . 1 . 1
S t a r t i n g O c t a v e
o c t a v e s t a r t i n t e r a c t i v e O c t a v e s e s s i o n
o c t a v e l e r u n O c t a v e o n c o m m a n d s i n l e
o c t a v e - - h e l p d e s c r i b e c o m m a n d l i n e o p t i o n s
S t o p p i n g O c t a v e
q u i t o r e x i t e x i t O c t a v e
I N T E R R U P T ( e . g . C - c ) t e r m i n a t e c u r r e n t c o m m a n d a n d
r e t u r n t o t o p - l e v e l p r o m p t
G e t t i n g H e l p
h e l p l i s t a l l c o m m a n d s a n d b u i l t - i n v a r i a b l e s
h e l p c o m m a n d b r i e y d e s c r i b e c o m m a n d
h e l p - i u s e I n f o t o b r o w s e O c t a v e m a n u a l
h e l p - i c o m m a n d s e a r c h f o r c o m m a n d i n O c t a v e m a n u a l
M o t i o n i n I n f o
S P C o r C - v s c r o l l f o r w a r d o n e s c r e e n f u l
D E L o r M - v s c r o l l b a c k w a r d o n e s c r e e n f u l
C - l r e d r a w t h e d i s p l a y
N o d e S e l e c t i o n i n I n f o
n s e l e c t t h e n e x t n o d e
p s e l e c t t h e p r e v i o u s n o d e
u s e l e c t t h e ` u p ' n o d e
t s e l e c t t h e ` t o p ' n o d e
d s e l e c t t h e d i r e c t o r y n o d e
< s e l e c t t h e r s t n o d e i n t h e c u r r e n t l e
> s e l e c t t h e l a s t n o d e i n t h e c u r r e n t l e
g r e a d s t h e n a m e o f a n o d e a n d s e l e c t s i t
C - x k k i l l s t h e c u r r e n t n o d e
S e a r c h i n g i n I n f o
s s e a r c h f o r a s t r i n g
C - s s e a r c h f o r w a r d i n c r e m e n t a l l y
C - r s e a r c h b a c k w a r d i n c r e m e n t a l l y
i s e a r c h i n d e x & g o t o c o r r e s p o n d i n g n o d e
, g o t o n e x t m a t c h f r o m l a s t ` i ' c o m m a n d
C o m m a n d - L i n e C u r s o r M o t i o n
C - b m o v e b a c k o n e c h a r a c t e r
C - f m o v e f o r w a r d o n e c h a r a c t e r
C - a m o v e t h e t h e s t a r t o f t h e l i n e
C - e m o v e t o t h e e n d o f t h e l i n e
M - f m o v e f o r w a r d a w o r d
M - b m o v e b a c k w a r d a w o r d
C - l c l e a r s c r e e n , r e p r i n t i n g c u r r e n t l i n e a t t o p
I n s e r t i n g o r C h a n g i n g T e x t
M - T A B i n s e r t a t a b c h a r a c t e r
D E L d e l e t e c h a r a c t e r t o t h e l e f t o f t h e c u r s o r
C - d d e l e t e c h a r a c t e r u n d e r t h e c u r s o r
C - v a d d t h e n e x t c h a r a c t e r v e r b a t i m
C - t t r a n s p o s e c h a r a c t e r s a t t h e p o i n t
M - t t r a n s p o s e w o r d s a t t h e p o i n t
] s u r r o u n d o p t i o n a l a r g u m e n t s . . . s h o w o n e o r m o r e a r g u m e n t s
C o p y r i g h t 1 9 9 6 , J o h n W . E a t o n P e r m i s s i o n s o n b a c k
K i l l i n g a n d Y a n k i n g
C - k k i l l t o t h e e n d o f t h e l i n e
C - y y a n k t h e m o s t r e c e n t l y k i l l e d t e x t
M - d k i l l t o t h e e n d o f t h e c u r r e n t w o r d
M - D E L k i l l t h e w o r d b e h i n d t h e c u r s o r
M - y r o t a t e t h e k i l l r i n g a n d y a n k t h e n e w t o p
C o m m a n d C o m p l e t i o n a n d H i s t o r y
T A B c o m p l e t e a c o m m a n d o r v a r i a b l e n a m e
M - ? l i s t p o s s i b l e c o m p l e t i o n s
R E T e n t e r t h e c u r r e n t l i n e
C - p m o v e ` u p ' t h r o u g h t h e h i s t o r y l i s t
C - n m o v e ` d o w n ' t h r o u g h t h e h i s t o r y l i s t
M - < m o v e t o t h e r s t l i n e i n t h e h i s t o r y
M - > m o v e t o t h e l a s t l i n e i n t h e h i s t o r y
C - r s e a r c h b a c k w a r d i n t h e h i s t o r y l i s t
C - s s e a r c h f o r w a r d i n t h e h i s t o r y l i s t
h i s t o r y - q ] N ] l i s t N p r e v i o u s h i s t o r y l i n e s , o m i t t i n g
h i s t o r y n u m b e r s i f - q
h i s t o r y - w l e ] w r i t e h i s t o r y t o l e ( ~ / . o c t a v e h i s t i f n o
l e a r g u m e n t )
h i s t o r y - r l e ] r e a d h i s t o r y f r o m l e ( ~ / . o c t a v e h i s t i f
n o l e a r g u m e n t )
e d i t h i s t o r y l i n e s e d i t a n d t h e n r u n p r e v i o u s c o m m a n d s
f r o m t h e h i s t o r y l i s t
r u n h i s t o r y l i n e s r u n p r e v i o u s c o m m a n d s f r o m t h e h i s t o r y
l i s t
b e g ] e n d ] S p e c i f y t h e r s t a n d l a s t h i s t o r y
c o m m a n d s t o e d i t o r r u n .
I f b e g i s g r e a t e r t h a n e n d , r e v e r s e t h e l i s t o f c o m m a n d s
b e f o r e e d i t i n g . I f e n d i s o m i t t e d , s e l e c t c o m m a n d s f r o m
b e g t o t h e e n d o f t h e h i s t o r y l i s t . I f b o t h a r g u m e n t s a r e
o m i t t e d , e d i t t h e p r e v i o u s i t e m i n t h e h i s t o r y l i s t .
S h e l l C o m m a n d s
c d d i r c h a n g e w o r k i n g d i r e c t o r y t o d i r
p w d p r i n t w o r k i n g d i r e c t o r y
l s o p t i o n s ] p r i n t d i r e c t o r y l i s t i n g
g e t e n v ( s t r i n g ) r e t u r n v a l u e o f n a m e d e n v i r o n m e n t
v a r i a b l e
s y s t e m ( c m d ) e x e c u t e a r b i t r a r y s h e l l c o m m a n d s t r i n g
M a t r i c e s
S q u a r e b r a c k e t s d e l i m i t l i t e r a l m a t r i c e s . C o m m a s s e p a r a t e
e l e m e n t s o n t h e s a m e r o w . S e m i c o l o n s s e p a r a t e r o w s . C o m m a s
m a y b e r e p l a c e d b y s p a c e s , a n d s e m i c o l o n s m a y b e r e p l a c e d b y
o n e o r m o r e n e w l i n e s . E l e m e n t s o f a m a t r i x m a y b e a r b i t r a r y
e x p r e s s i o n s , p r o v i d e d t h a t a l l t h e d i m e n s i o n s a g r e e .
x , y , . . . ] e n t e r a r o w v e c t o r
x ; y ; . . . ] e n t e r a c o l u m n v e c t o r
w , x ; y , z ] e n t e r a 2 2 m a t r i x
R a n g e s
b a s e : l i m i t
b a s e : i n c r : l i m i t
S p e c i f y a r a n g e o f v a l u e s b e g i n n i n g w i t h b a s e w i t h n o
e l e m e n t s g r e a t e r t h a n l i m i t . I f i t i s o m i t t e d , t h e d e f a u l t
v a l u e o f i n c r i s 1 . N e g a t i v e i n c r e m e n t s a r e p e r m i t t e d .
S t r i n g s a n d C o m m o n E s c a p e S e q u e n c e s
A s t r i n g c o n s t a n t c o n s i s t s o f a s e q u e n c e o f c h a r a c t e r s e n c l o s e d
i n e i t h e r d o u b l e - q u o t e o r s i n g l e - q u o t e m a r k s .
\ \ a l i t e r a l b a c k s l a s h
\ " a l i t e r a l d o u b l e - q u o t e c h a r a c t e r
\ ' a l i t e r a l s i n g l e - q u o t e c h a r a c t e r
\ n n e w l i n e , A S C I I c o d e 1 0
\ t h o r i z o n t a l t a b , A S C I I c o d e 9
I n d e x E x p r e s s i o n s
v a r ( i d x ) s e l e c t e l e m e n t s o f a v e c t o r
v a r ( i d x 1 , i d x 2 ) s e l e c t e l e m e n t s o f a m a t r i x
s c a l a r s e l e c t r o w ( c o l u m n ) c o r r e s p o n d i n g t o
s c a l a r
v e c t o r s e l e c t r o w s ( c o l u m n s ) c o r r e s p o n d i n g t o t h e
e l e m e n t s o f v e c t o r
r a n g e s e l e c t r o w s ( c o l u m n s ) c o r r e s p o n d i n g t o t h e
e l e m e n t s o f r a n g e
: s e l e c t a l l r o w s ( c o l u m n s )
G l o b a l V a r i a b l e s
g l o b a l v a r 1 . . . D e c l a r e v a r i a b l e s g l o b a l .
G l o b a l v a r i a b l e s m a y b e a c c e s s e d i n s i d e t h e b o d y o f a
f u n c t i o n w i t h o u t h a v i n g t o b e p a s s e d i n t h e f u n c t i o n
p a r a m e t e r l i s t p r o v i d e d t h e y a r e a l s o d e c l a r e d g l o b a l w i t h i n
t h e f u n c t i o n .
S e l e c t e d B u i l t - i n V a r i a b l e s
E D I T O R e d i t o r t o u s e w i t h e d i t h i s t o r y
I n f , N a N I E E E i n n i t y , N a N
L O A D P A T H p a t h t o s e a r c h f o r f u n c t i o n l e s
P A G E R p r o g r a m t o u s e t o p a g i n a t e o u t p u t
a n s l a s t r e s u l t n o t e x p l i c i t l y a s s i g n e d
e p s m a c h i n e p r e c i s i o n
p i
r e a l m a x m a x i m u m r e p r e s e n t a b l e v a l u e
r e a l m i n m i n i m u m r e p r e s e n t a b l e v a l u e
a u t o m a t i c r e p l o t a u t o m a t i c a l l y r e d r a w p l o t s
d o f o r t r a n i n d e x i n g F o r t r a n - s t y l e i n d e x i n g o f m a t r i c e s
i m p l i c i t s t r t o n u m o k a l l o w s t r i n g s t o b e c o m e n u m b e r s
o u t p u t m a x f i e l d w i d t h m a x i m u m n u m e r i c e l d w i d t h
o u t p u t p r e c i s i o n m i n s i g n i c a n t g u r e s d i s p l a y e d
p a g e s c r e e n o u t p u t c o n t r o l w h e t h e r o u t p u t i s p a g e d
p r e f e r c o l u m n v e c t o r s c r e a t e c o l u m n v e c t o r s b y d e f a u l t
r e s i z e o n r a n g e e r r o r a u t o m a t i c r e s i z i n g o f m a t r i c e s
s a v e p r e c i s i o n d i g i t s s t o r e d b y s a v e c o m m a n d
s i l e n t f u n c t i o n s s u p p r e s s o u t p u t f r o m f u n c t i o n s
w a r n d i v i d e b y z e r o s u p p r e s s d i v i d e b y z e r o e r r o r s
c o m m a s i n l i t e r a l m a t r i x
c o n t r o l h a n d l i n g o f s p a c e s i n m a t r i c e s
i g n o r e f u n c t i o n t i m e s t a m p
i g n o r e c h a n g e s i n f u n c t i o n l e s d u r i n g s e s s i o n
o k t o l o s e i m a g i n a r y p a r t
a l l o w c o m p l e x t o r e a l c o n v e r s i o n
p r e f e r z e r o o n e i n d e x i n g
i f a m b i g u o u s , p r e f e r 0 - 1 s t y l e i n d e x i n g
-
8/16/2019 Octave - Referência Dos Botões
2/3
A r i t h m e t i c a n d I n c r e m e n t O p e r a t o r s
x + y a d d i t i o n
x - y s u b t r a c t i o n
x * y m a t r i x m u l t i p l i c a t i o n
x . * y e l e m e n t b y e l e m e n t m u l t i p l i c a t i o n
x / y r i g h t d i v i s i o n , c o n c e p t u a l l y e q u i v a l e n t t o
( i n v e r s e ( y ' ) * x ' ) '
x . / y e l e m e n t b y e l e m e n t r i g h t d i v i s i o n
x \ y l e f t d i v i s i o n , c o n c e p t u a l l y e q u i v a l e n t t o
i n v e r s e ( x ) * y
x . \ y e l e m e n t b y e l e m e n t l e f t d i v i s i o n
x ^ y p o w e r o p e r a t o r
x . ^ y e l e m e n t b y e l e m e n t p o w e r o p e r a t o r
- x n e g a t i o n
+ x u n a r y p l u s ( a n o - o p )
x ' c o m p l e x c o n j u g a t e t r a n s p o s e
x . ' t r a n s p o s e
+ + x ( - - x ) i n c r e m e n t ( d e c r e m e n t ) x , r e t u r n n e w v a l u e
x + + ( x - - ) i n c r e m e n t ( d e c r e m e n t ) x , r e t u r n o l d v a l u e
A s s i g n m e n t E x p r e s s i o n s
v a r = e x p r a s s i g n e x p r e s s i o n t o v a r i a b l e
v a r ( i d x ) = e x p r a s s i g n e x p r e s s i o n t o i n d e x e d v a r i a b l e
C o m p a r i s o n a n d B o o l e a n O p e r a t o r s
T h e s e o p e r a t o r s w o r k o n a n e l e m e n t - b y - e l e m e n t b a s i s . B o t h
a r g u m e n t s a r e a l w a y s e v a l u a t e d .
x < y t r u e i f x i s l e s s t h a n y
x < = y t r u e i f x i s l e s s t h a n o r e q u a l t o y
x = = y t r u e i f x i s g r e a t e r t h a n y
x > = y t r u e i f x i s g r e a t e r t h a n o r e q u a l t o y
x > y t r u e i f x i s e q u a l t o y
x ! = y t r u e i f x i s n o t e q u a l t o y
x & y t r u e i f b o t h x a n d y a r e t r u e
x | y t r u e i f a t l e a s t o n e o f x o r y i s t r u e
! b o o l t r u e b o o l i s f a l s e
S h o r t - c i r c u i t B o o l e a n O p e r a t o r s
O p e r a t o r s e v a l u a t e l e f t - t o - r i g h t , e x p e c t i n g s c a l a r o p e r a n d s .
O p e r a n d s a r e o n l y e v a l u a t e d i f n e c e s s a r y , s t o p p i n g o n c e o v e r a l l
t r u t h v a l u e c a n b e d e t e r m i n e d . O p e r a n d s a r e c o n v e r t e d t o
s c a l a r s b y a p p l y i n g t h e a l l f u n c t i o n .
x & & y t r u e i f b o t h x a n d y a r e t r u e
x | | y t r u e i f a t l e a s t o n e o f x o r y i s t r u e
O p e r a t o r P r e c e d e n c e
H e r e i s a t a b l e o f t h e o p e r a t o r s i n O c t a v e , i n o r d e r o f
i n c r e a s i n g p r e c e d e n c e .
; , s t a t e m e n t s e p a r a t o r s
= a s s i g n m e n t , g r o u p s l e f t t o r i g h t
| | & & l o g i c a l \ o r " a n d \ a n d "
| & e l e m e n t - w i s e \ o r " a n d \ a n d "
< < = = = > = > ! = r e l a t i o n a l o p e r a t o r s
: c o l o n
+ - a d d i t i o n a n d s u b t r a c t i o n
* / \ . * . / . \ m u l t i p l i c a t i o n a n d d i v i s i o n
' . ' t r a n s p o s e
+ - + + - - ! u n a r y m i n u s , i n c r e m e n t , l o g i c a l \ n o t "
^ . ^ e x p o n e n t i a t i o n
S t a t e m e n t s
f o r i d e n t i e r = e x p r s t m t - l i s t e n d f o r
E x e c u t e s t m t - l i s t o n c e f o r e a c h c o l u m n o f e x p r . T h e v a r i a b l e
i d e n t i e r i s s e t t o t h e v a l u e o f t h e c u r r e n t c o l u m n d u r i n g
e a c h i t e r a t i o n .
w h i l e ( c o n d i t i o n ) s t m t - l i s t e n d w h i l e
E x e c u t e s t m t - l i s t w h i l e c o n d i t i o n i s t r u e .
b r e a k e x i t i n n e r m o s t l o o p
c o n t i n u e g o t o b e g i n n i n g o f i n n e r m o s t l o o p
r e t u r n r e t u r n t o c a l l i n g f u n c t i o n
i f ( c o n d i t i o n ) i f - b o d y e l s e e l s e - b o d y ] e n d i f
E x e c u t e i f - b o d y i f c o n d i t i o n i s t r u e , o t h e r w i s e e x e c u t e e l s e -
b o d y .
i f ( c o n d i t i o n ) i f - b o d y e l s e i f ( c o n d i t i o n ) e l s e i f - b o d y ] e n d i f
E x e c u t e i f - b o d y i f c o n d i t i o n i s t r u e , o t h e r w i s e e x e c u t e t h e
e l s e i f - b o d y c o r r e s p o n d i n g t o t h e r s t e l s e i f c o n d i t i o n t h a t
i s t r u e , o t h e r w i s e e x e c u t e e l s e - b o d y .
A n y n u m b e r o f e l s e i f c l a u s e s m a y a p p e a r i n a n i f
s t a t e m e n t .
u n w i n d p r o t e c t b o d y u n w i n d p r o t e c t c l e a n u p c l e a n u p e n d
E x e c u t e b o d y . E x e c u t e c l e a n u p n o m a t t e r h o w c o n t r o l e x i t s
b o d y .
D e n i n g F u n c t i o n s
f u n c t i o n r e t - l i s t ] f u n c t i o n - n a m e ( a r g - l i s t ) ]
f u n c t i o n - b o d y
e n d f u n c t i o n
r e t - l i s t m a y b e a s i n g l e i d e n t i e r o r a c o m m a - s e p a r a t e d l i s t o f
i d e n t i e r s d e l i m i t e d b y s q u a r e - b r a c k e t s .
a r g - l i s t i s a c o m m a - s e p a r a t e d l i s t o f i d e n t i e r s a n d m a y b e
e m p t y .
B a s i c M a t r i x M a n i p u l a t i o n s
r o w s ( a ) r e t u r n n u m b e r o f r o w s o f a
c o l u m n s ( a ) r e t u r n n u m b e r o f c o l u m n s o f a
a l l ( a ) c h e c k i f a l l e l e m e n t s o f a n o n z e r o
a n y ( a ) c h e c k i f a n y e l e m e n t s o f a n o n z e r o
f i n d ( a ) r e t u r n i n d i c e s o f n o n z e r o e l e m e n t s
s o r t ( a ) o r d e r e l e m e n t s i n e a c h c o l u m n o f a
s u m ( a ) s u m e l e m e n t s i n c o l u m n s o f a
p r o d ( a ) p r o d u c t o f e l e m e n t s i n c o l u m n s o f a
m i n ( a r g s ) n d m i n i m u m v a l u e s
m a x ( a r g s ) n d m a x i m u m v a l u e s
r e m ( x , y ) n d r e m a i n d e r o f x / y
r e s h a p e ( a , m , n ) r e f o r m a t a t o b e m b y n
d i a g ( v , k ) c r e a t e d i a g o n a l m a t r i c e s
l i n s p a c e ( b , l , n ) c r e a t e v e c t o r o f l i n e a r l y - s p a c e d e l e m e n t s
l o g s p a c e ( b , l , n ) c r e a t e v e c t o r o f l o g - s p a c e d e l e m e n t s
e y e ( n , m ) c r e a t e n b y m i d e n t i t y m a t r i x
o n e s ( n , m ) c r e a t e n b y m m a t r i x o f o n e s
z e r o s ( n , m ) c r e a t e n b y m m a t r i x o f z e r o s
r a n d ( n , m ) c r e a t e n b y m m a t r i x o f r a n d o m v a l u e s
L i n e a r A l g e b r a
c h o l ( a ) C h o l e s k y f a c t o r i z a t i o n
d e t ( a ) c o m p u t e t h e d e t e r m i n a n t o f a m a t r i x
e i g ( a ) e i g e n v a l u e s a n d e i g e n v e c t o r s
e x p m ( a ) c o m p u t e t h e e x p o n e n t i a l o f a m a t r i x
h e s s ( a ) c o m p u t e H e s s e n b e r g d e c o m p o s i t i o n
i n v e r s e ( a ) i n v e r t a s q u a r e m a t r i x
n o r m ( a , p ) c o m p u t e t h e p - n o r m o f a m a t r i x
p i n v ( a ) c o m p u t e p s e u d o i n v e r s e o f a
q r ( a ) c o m p u t e t h e Q R f a c t o r i z a t i o n o f a m a t r i x
r a n k ( a ) m a t r i x r a n k
s c h u r ( a ) S c h u r d e c o m p o s i t i o n o f a m a t r i x
s v d ( a ) s i n g u l a r v a l u e d e c o m p o s i t i o n
s y l ( a , b , c ) s o l v e t h e S y l v e s t e r e q u a t i o n
E q u a t i o n s , O D E s , D A E s , Q u a d r a t u r e
* f s o l v e s o l v e n o n l i n e a r a l g e b r a i c e q u a t i o n s
* l s o d e i n t e g r a t e n o n l i n e a r O D E s
* d a s s l i n t e g r a t e n o n l i n e a r D A E s
* q u a d i n t e g r a t e n o n l i n e a r f u n c t i o n s
p e r r o r ( n m , c o d e ) f o r f u n c t i o n s t h a t r e t u r n n u m e r i c c o d e s ,
p r i n t e r r o r m e s s a g e f o r n a m e d f u n c t i o n
a n d g i v e n e r r o r c o d e
* S e e t h e o n - l i n e o r p r i n t e d m a n u a l f o r t h e c o m p l e t e l i s t o f
a r g u m e n t s f o r t h e s e f u n c t i o n s .
S i g n a l P r o c e s s i n g
f f t ( a ) F a s t F o u r i e r T r a n s f o r m u s i n g F F T P A C K
i f f t ( a ) i n v e r s e F F T u s i n g F F T P A C K
f r e q z ( a r g s ) F I R l t e r f r e q u e n c y r e s p o n s e
s i n c ( x ) r e t u r n s s i n ( x ) / ( x )
I m a g e P r o c e s s i n g
c o l o r m a p ( m a p ) s e t t h e c u r r e n t c o l o r m a p
g r a y 2 i n d ( i , n ) c o n v e r t g r a y s c a l e t o O c t a v e i m a g e
i m a g e ( i m g , z o o m ) d i s p l a y a n O c t a v e i m a g e m a t r i x
i m a g e s c ( i m g , z o o m ) d i s p l a y s c a l e d m a t r i x a s i m a g e
i m s h o w ( i m g , m a p ) d i s p l a y O c t a v e i m a g e
i m s h o w ( i , n ) d i s p l a y g r a y s c a l e i m a g e
i m s h o w ( r , g , b ) d i s p l a y R G B i m a g e
i n d 2 g r a y ( i m g , m a p ) c o n v e r t O c t a v e i m a g e t o g r a y s c a l e
i n d 2 r g b ( i m g , m a p ) c o n v e r t i n d e x e d i m a g e t o R G B
l o a d i m a g e ( l e ) l o a d a n i m a g e l e
r g b 2 i n d ( r , g , b ) c o n v e r t R G B t o O c t a v e i m a g e
s a v e i m a g e ( l e , i m g , f m t , m a p ) s a v e a m a t r i x t o l e
S e t s
c r e a t e s e t ( a , b ) c r e a t e r o w v e c t o r o f u n i q u e v a l u e s
c o m p l e m e n t ( a , b ) e l e m e n t s o f b n o t i n a
i n t e r s e c t i o n ( a , b ) i n t e r s e c t i o n o f s e t s a a n d b
u n i o n ( a , b ) u n i o n o f s e t s a a n d b
S t r i n g s
s t r c m p ( s , t ) c o m p a r e s t r i n g s
s t r c a t ( s , t , . . . ) c o n c a t e n a t e s t r i n g s
-
8/16/2019 Octave - Referência Dos Botões
3/3
C - s t y l e I n p u t a n d O u t p u t
f o p e n ( n a m e , m o d e ) o p e n l e n a m e
f c l o s e ( l e ) c l o s e l e
p r i n t f ( f m t , . . . ) f o r m a t t e d o u t p u t t o s t d o u t
f p r i n t f ( l e , f m t , . . . ) f o r m a t t e d o u t p u t t o l e
s p r i n t f ( f m t , . . . ) f o r m a t t e d o u t p u t t o s t r i n g
s c a n f ( f m t ) f o r m a t t e d i n p u t f r o m s t d i n
f s c a n f ( l e , f m t ) f o r m a t t e d i n p u t f r o m l e
s s c a n f ( s t r , f m t ) f o r m a t t e d i n p u t f r o m s t r i n g
f g e t s ( l e , l e n ) r e a d l e n c h a r a c t e r s f r o m l e
f f l u s h ( l e ) u s h p e n d i n g o u t p u t t o l e
f t e l l ( l e ) r e t u r n l e p o i n t e r p o s i t i o n
f r e w i n d ( l e ) m o v e l e p o i n t e r t o b e g i n n i n g
f r e p o r t p r i n t a i n f o f o r o p e n l e s
f r e a d ( l e , s i z e , p r e c ) r e a d b i n a r y d a t a l e s
f w r i t e ( l e , s i z e , p r e c ) w r i t e b i n a r y d a t a l e s
f e o f ( l e ) d e t e r m i n e i f p o i n t e r i s a t E O F
A l e m a y b e r e f e r e n c e d e i t h e r b y n a m e o r b y t h e n u m b e r
r e t u r n e d f r o m f o p e n . T h r e e l e s a r e p r e c o n n e c t e d w h e n O c t a v e
s t a r t s : s t d i n , s t d o u t , a n d s t d e r r .
O t h e r I n p u t a n d O u t p u t f u n c t i o n s
s a v e l e v a r . . . s a v e v a r i a b l e s i n l e
l o a d l e l o a d v a r i a b l e s f r o m l e
d i s p ( v a r ) d i s p l a y v a l u e o f v a r t o s c r e e n
M i s c e l l a n e o u s F u n c t i o n s
e v a l ( s t r ) e v a l u a t e s t r a s a c o m m a n d
f e v a l ( s t r , . . . ) e v a l u a t e f u n c t i o n n a m e d b y s t r , p a s s i n g
r e m a i n i n g a r g s t o c a l l e d f u n c t i o n
e r r o r ( m e s s a g e ) p r i n t m e s s a g e a n d r e t u r n t o t o p l e v e l
c l e a r p a t t e r n c l e a r v a r i a b l e s m a t c h i n g p a t t e r n
e x i s t ( s t r ) c h e c k e x i s t e n c e o f v a r i a b l e o r f u n c t i o n
w h o l i s t c u r r e n t v a r i a b l e s
P o l y n o m i a l s
c o m p a n ( p ) c o m p a n i o n m a t r i x
c o n v ( a , b ) c o n v o l u t i o n
d e c o n v ( a , b ) d e c o n v o l v e t w o v e c t o r s
p o l y ( a ) c r e a t e p o l y n o m i a l f r o m a m a t r i x
p o l y d e r i v ( p ) d e r i v a t i v e o f p o l y n o m i a l
p o l y r e d u c e ( p ) i n t e g r a l o f p o l y n o m i a l
p o l y v a l ( p , x ) v a l u e o f p o l y n o m i a l a t x
p o l y v a l m ( p , x ) v a l u e o f p o l y n o m i a l a t x
r o o t s ( p ) p o l y n o m i a l r o o t s
r e s i d u e ( a , b ) p a r t i a l f r a c t i o n e x p a n s i o n o f r a t i o a / b
S t a t i s t i c s
c o r r c o e f ( x , y ) c o r r e l a t i o n c o e c i e n t
c o v ( x , y ) c o v a r i a n c e
m e a n ( a ) m e a n v a l u e
m e d i a n ( a ) m e d i a n v a l u e
s t d ( a ) s t a n d a r d d e v i a t i o n
v a r ( a ) v a r i a n c e
B a s i c P l o t t i n g
g p l o t r a n g e s ] e x p r u s i n g ] t i t l e ] s t y l e ] 2 D p l o t t i n g
g s p l o t r a n g e s ] e x p r u s i n g ] t i t l e ] s t y l e ] 3 D p l o t t i n g
r a n g e s s p e c i f y d a t a r a n g e s
e x p r e x p r e s s i o n t o p l o t
u s i n g s p e c i f y c o l u m n s t o p l o t
t i t l e s p e c i f y l i n e t i t l e f o r l e g e n d
s t y l e s p e c i f y l i n e s t y l e
I f r a n g e s a r e s u p p l i e d , t h e y m u s t c o m e b e f o r e t h e e x p r e s s i o n
t o p l o t . T h e u s i n g , t i t l e , a n d s t y l e o p t i o n s m a y a p p e a r i n a n y
o r d e r a f t e r e x p r . M u l t i p l e e x p r e s s i o n s m a y b e p l o t t e d w i t h a
s i n g l e c o m m a n d b y s e p a r a t i n g t h e m w i t h c o m m a s .
s e t o p t i o n s s e t p l o t t i n g o p t i o n s
s h o w o p t i o n s s h o w p l o t t i n g o p t i o n s
r e p l o t r e d i s p l a y c u r r e n t p l o t
c l o s e p l o t c l o s e s t r e a m t o g n u p l o t p r o c e s s
p u r g e t m p f i l e s c l e a n u p t e m p o r a r y p l o t t i n g l e s
a u t o m a t i c r e p l o t b u i l t - i n v a r i a b l e
O t h e r P l o t t i n g F u n c t i o n s
p l o t ( a r g s ) 2 D p l o t w i t h l i n e a r a x e s
s e m i l o g x ( a r g s ) 2 D p l o t w i t h l o g a r i t h m i c x - a x i s
s e m i l o g y ( a r g s ) 2 D p l o t w i t h l o g a r i t h m i c y - a x i s
l o g l o g ( a r g s ) 2 D p l o t w i t h l o g a r i t h m i c a x e s
b a r ( a r g s ) p l o t b a r c h a r t s
s t a i r s ( x , y ) p l o t s t a i r s t e p s
h i s t ( y , x ) p l o t h i s t o g r a m s
t i t l e ( s t r i n g ) s e t p l o t t i t l e
a x i s ( l i m i t s ) s e t a x i s r a n g e s
x l a b e l ( s t r i n g ) s e t x - a x i s l a b e l
y l a b e l ( s t r i n g ) s e t y - a x i s l a b e l
g r i d o n j o ] s e t g r i d s t a t e
h o l d o n j o ] s e t h o l d s t a t e
i s h o l d r e t u r n 1 i f h o l d i s o n , 0 o t h e r w i s e
m e s h ( x , y , z ) p l o t 3 D s u r f a c e
m e s h d o m ( x , y ) c r e a t e m e s h c o o r d i n a t e m a t r i c e s
E d i t i o n 1 . 1 f o r O c t a v e V e r s i o n 1 . 1 . 1 . C o p y r i g h t 1 9 9 6 , J o h n W . E a t o n
( j w e @ c h e . u t e x a s . e d u ) . T h e a u t h o r a s s u m e s n o r e s p o n s i b i l i t y f o r a n y
e r r o r s o n t h i s c a r d .
T h i s c a r d m a y b e f r e e l y d i s t r i b u t e d u n d e r t h e t e r m s o f t h e G N U
G e n e r a l P u b l i c L i c e n s e .
T
E
X M a c r o s f o r t h i s c a r d b y R o l a n d P e s c h ( p e s c h @ c y g n u s . c o m ) ,
o r i g i n a l l y f o r t h e G D B r e f e r e n c e c a r d
O c t a v e i t s e l f i s f r e e s o f t w a r e ; y o u a r e w e l c o m e t o d i s t r i b u t e c o p i e s
o f i t u n d e r t h e t e r m s o f t h e G N U G e n e r a l P u b l i c L i c e n s e . T h e r e i s
a b s o l u t e l y n o w a r r a n t y f o r O c t a v e .