-
Notifications
You must be signed in to change notification settings - Fork 1
Home
rdbyk edited this page Apr 24, 2018
·
133 revisions
- Use
typeinstead oftypeof, whenever possible. - Use
nargin,nargoutinstead ofargn. - Use
x==[]instead ofisempty(x), whenever possible. - Use
x<>[]instead of~isempty(x), whenever possible. - Use
issquareinstead 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
execstrinstead ofevstr, whenever possible. - Use
tokensinstead ofstrsplit, whenever possible. - Use
matrix(A,length(A),1)instead ofA(:), whenever possible. - Use
A.Binstead ofA("B")orgetfield("B",A), whenever possible. - Use
ones(m,n).*.Ainstead ofrepmat(A,m,n), whenever possible. - Use
size(x)==1instead ofisscalar(x), whenever possible. - Use
A=[]instead ofA(:)=[], whenever possible. - Use
.*and./instead*of/for integer types, whenever possible. - Use
a & binstead ofbitand(a,b), whenever possible. - Use
a | binstead ofbitor(a,b), whenever possible. - Use
(a | b) & ~(a & b)instead ofbitxor(a,b), whenever possible.
%t./%fsleep 11:null()1./int8(0)1:insert()sparse(1,1)int8(0):0:0mprintf("%%")msprintf("%%")[null(),null()]triu([%s+%i,1;1,1])covStart(["a";"b"])[insert(),insert()]strsubst("","","","r")strsubst('aaa','aa','a')S=struct();S(2,2)=struct()surf(1:2e3,1:2e3,(1:2e3)'*(1:2e3))f=gcf();xdel();save(TMPDIR+"/f.sod","f")function f(),ver()(1,2),end;macr2tree(f)a={%s};p=TMPDIR+"/a.sod";save(p,"a");listvarinfile(p)
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
-
isprotected,protect,unprotect- Provide an interface to the protection mechanism of arbitrary variables
- They supersede
predefand are easy to use (cf. #420)