-
Notifications
You must be signed in to change notification settings - Fork 1
Home
rdbyk edited this page Dec 4, 2020
·
133 revisions
- Use
type
instead oftypeof
, whenever possible. - Use
nargin
,nargout
instead ofargn
. - Use
x==[]
instead ofisempty(x)
, whenever possible. - Use
x<>[]
instead of~isempty(x)
, whenever possible. - Use
issquare
instead ofsize
, whenever possible. - Use
length(x)
instead ofsize(x,'*')
, whenever possible. - Use
x(length(x))
orx(size(x,'*')
instead ofx($)
, whenever possible. - Use
&&
,||
instead of&
,|
, whenever possible. - Use
~(A || B)
instead of~A && ~B
(cf. De Morgan's Laws). - Use
~(A && B)
instead of~A || ~B
(cf. De Morgan's Laws). - Use
execstr
instead ofevstr
, whenever possible. - Use
tokens
instead ofstrsplit
, whenever possible. - Use
matrix(A,length(A),1)
instead ofA(:)
, whenever possible. - Use
A.B
instead ofA("B")
orgetfield("B",A)
, whenever possible. - Use
ones(m,n).*.A
instead ofrepmat(A,m,n)
, whenever possible. - Use
size(x)==1
instead ofisscalar(x)
orsize(x,'*')==1
, whenever possible. - Use
A=[]
instead ofA(:)=[]
, whenever possible. - Use
.*
and./
instead*
of/
for integer types, whenever possible. - Use
a & b
instead ofbitand(a,b)
, whenever possible. - Use
a | b
instead ofbitor(a,b)
, whenever possible. - Use
(a | b) & ~(a & b)
instead ofbitxor(a,b)
, whenever possible. - Use
// Blah Blah
only sparingly (cf. #488). - Use
eye()
instead ofeye(A)
oreye(n,m)
, whenever possible. - Use
{}
instead ofcell()
, whenever possible. - Use
a+imult(b)
instead ofcomplex(a,b)
, whenever possible. - Use
[f,e]=frexp(x)
instead of[f,e]=log2(x)
, whenever possible. - Use
x
instead ofx<>0
, whenever possible. - Use
x.^(1./n)
instead ofnthroot(x,n)
, whenever possible. - Use
a+b*%i
instead ofcomplex(a,b)
ora+imult(b)
, whenever possible. - Use
A(:,size(A,2):-1:1)
instead offlipdim(A,2)
, whenever possible. - Use
A==B
instead ofisequal(A,B)
, whenever possible. - Use
list(A(:),B(:))
instead oflstcat(A,B)
, whenever possible. - Use
a:(b-a)/(n-1):b
instead oflinspace(a,b,n)
, whenever possible. - Use
strrchr(file,'.') instead of
fileparts(file,'extension')`, whenever possible. - Use
strncpy(x,n)
instead ofpart(x,1:n)
, whenever possible. - Use
X=[]
instead ofX(:)=[]
orX(:,:,...)=[]
, whenever possible.
{1:$}
~who()
sleep 1
a().b=1
1|who()
atan(1,)
cell(-1)
sin{1}=1
1.*.eye()
1./.eye()
1.\.eye()
imult(%s)
{1,2}'(1)
1./int8(0)
int8(0).\1
x=1;x()=[]
p=1:$;p(:)
a(list())=1
eye()/eye()
eye()\eye()
expm(eye())
{list()(:)}
if who(),end
A=1;A(1,%nan)
for i=1:$,end
min(eye(),"r")
max(eye(),"r")
struct("a",{})
[null(),null()]
ereduc(eye(),1)
sprand(-1,1,.1)
while who(),end
for w=who(),end
isvector(list())
cumsum(eye(),"r")
sprand(1e3,1e3,1)
sparse([1 0.5],1)
cumprod(eye(),"r")
fromJSON("{""""}")
triu([%s+%i,1;1,1])
covStart(["a";"b"])
[insert(),insert()]
write(6,1:3,"(I2)")
matrix(1,ones(34,1))
s.a=1;getfield("b",s)
saveafterncommands(1)
strsubst("","","","r")
permute([2,2],40:-1:1)
strsubst('aaa','aa','a')
S=struct();S(2,2)=struct()
L=list();L(2)=insert();L(1)
u=["a","b"];v(1,:)=u,u(:,:)
gcf().color_map=rand(2e6,3)
a=struct("b",null());a.b=a.b
surf(1:2e3,1:2e3,(1:2e3)'*(1:2e3))
x=tlist("x");function %x_s(a),end;-x
f=gcf();xdel();save(TMPDIR+"/f.sod","f")
deff('f(a,b)','plot2d(a,a,style=b)'),f(1,)
A=ones(1000,1001);for i=1:1e4,try,inv(A),end,end
C{1}=null();save("/tmp/T","C");clear("C");load("/tmp/T")
to be continued ...
-
%balisc
- Useful to check whether it is Balisc, e.g. use
exists("%balisc")
. - Returns a single integer (e.g.
0
), which indicates the version of Balisc
- Useful to check whether it is Balisc, e.g. use
-
–
- Shorthand for
void()
- Ignore outputs of functions, e.g.
[–,b]=frexp(7.93)
(cf. #1003)
- Shorthand for
-
bitpack
,bitunpack
-
errmsgs
- Returns predefined error messages and associated error numbers
-
fflush
- Flushes streams opened by
mopen
orpopen
- Flushes streams opened by
-
flintmax
- Return the largest integer that can be represented consecutively in a floating point value
-
funname
-
funref
-
inner
- Move or create a variable to or in the inner (current) scope
-
intmax
- Return the largest integer that can be represented in an integer type
-
intmin
- Return the smallest integer that can be represented in an integer type
-
isprotected
,protect
,unprotect
- Provide an interface to the protection mechanism of arbitrary variables
- They supersede
predef
and are easy to use (cf. #420)
-
macrofile
-
outer
- Move or create a variable to or in the outer (previous) scope
-
popen
- Executes a command and connects a pipe to the corresponding process
-
rmfield
-
swapbytes
-
typecast
-
void
-
lstcat
was buggy and slow, uselist
-
bitstring
is a very specialized function and is (now) redundant- e.g. use
dec2base(typecast(%pi,'uint64'),2,64)
instead ofbitstring(%pi)
- e.g. use
-
argn
was redundant and rather slow, usenargin
andnargout
instead.
-
getscilabkeywords
redundant, useisprotected
,librarieslist
,libraryinfo
, ... -
predef
had limited functionality, useisprotected
,protect
,unprotect
-
banner
useless, nobody needs it -
funptr
outdated and useless -
getURL
redundant, usehttp_xxx
functions -
oldEmptyBehaviour
was annoying, thus completely removed -
otherwise
undocumented and redundant, useelse
-
predef
had limited functionality, useisprotected
,protect
,unprotect
-
read_csv
redundant, usecsvRead
-
resume
redundant, usereturn
-
splitURL
, usemsscanf
function to do the job -
switch
undocumented and redundant, useselect
-
write_csv
redundant, usecsvWrite