Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Jesse Heckman
pbtoolbox
Commits
f25e9dea
Commit
f25e9dea
authored
Oct 26, 2018
by
Jesse Heckman
Browse files
update utilities / math
parent
1903593c
Changes
4
Hide whitespace changes
Inline
Side-by-side
utilities/housekeeping/pb_clean.m
View file @
f25e9dea
...
...
@@ -14,7 +14,7 @@ function pb_clean(varargin)
if
fig
;
close
all
;
end
if
empty
;
clc
;
end
if
clr
;
evalin
(
'base'
,
'
clear
'
)
;
end
if
clr
;
pb_
clear
;
end
end
% % % % % % % % % % % % % % % % % % % % % % % % % % % % % % %
...
...
utilities/housekeeping/pb_clear.m
0 → 100644
View file @
f25e9dea
function
pb_clear
(
varargin
)
% PB_CLEAR(varargin)
%
% PB_CLEAR() clears the base workspace with the exception of variables
% passed along to varargin.
%
% See also PB_CLEAN
% PBToolbox (2018): JJH: j.heckman@donders.ru.nl
list
=
evalin
(
'base'
,
'who'
);
listsz
=
length
(
list
);
listArr
=
1
:
listsz
;
keep
=
varargin
'
;
keepsz
=
length
(
keep
);
for
iKeep
=
1
:
keepsz
var
=
keep
{
iKeep
};
idx
=
find
(
strcmp
(
list
,
var
));
if
~
isempty
(
idx
)
list
=
list
(
listArr
(
listArr
~=
idx
));
listsz
=
length
(
list
);
listArr
=
1
:
listsz
;
end
end
listsz
=
length
(
list
);
if
listsz
>
0
baseCommand
=
'clear('
;
for
iClear
=
1
:
listsz
baseCommand
=
[
baseCommand
'
''
'
list
{
iClear
}
'
''
'
];
if
iClear
<
listsz
baseCommand
=
[
baseCommand
','
];
else
baseCommand
=
[
baseCommand
')'
];
end
end
evalin
(
'base'
,
baseCommand
)
end
end
% % % % % % % % % % % % % % % % % % % % % % % % % % % % % % %
% %
% Part of Programmeer Beer Toolbox (PBToolbox) %
% Written by: Jesse J. Heckman (2018) %
% %
% % % % % % % % % % % % % % % % % % % % % % % % % % % % % % %
utilities/housekeeping/pb_delete.m
View file @
f25e9dea
...
...
@@ -16,7 +16,7 @@ function pb_delete(varargin)
len
=
length
(
h
);
for
iH
=
1
:
len
if
contains
(
h
(
iH
)
.
Type
,
'
A
xes'
)
||
contains
(
h
(
iH
)
.
Type
,
'
F
igure'
)
if
contains
(
h
(
iH
)
.
Type
,
'
a
xes'
)
||
contains
(
h
(
iH
)
.
Type
,
'
f
igure'
)
cnt
=
cnt
+
1
;
end
end
...
...
utilities/math/pb_pythagoras.m
0 → 100644
View file @
f25e9dea
function
c
=
pb_pythagoras
(
a
,
b
)
% PB_PYTHAGORAS(a,b)
%
% PB_PYTHAGORAS(a,b) ...
%
% See also ...
% PBToolbox (2018): JJH: j.heckman@donders.ru.nl
if
mean
(
a
)
<
0
;
sign
=
-
1
;
else
;
sign
=
1
;
end
if
mean
(
b
)
<
0
;
sign
=
-
1
*
sign
;
end
c
=
sqrt
(
a
.^
2
+
b
.^
2
)
*
sign
;
end
% % % % % % % % % % % % % % % % % % % % % % % % % % % % % % %
% %
% Part of Programmeer Beer Toolbox (PBToolbox) %
% Written by: Jesse J. Heckman (2018) %
% %
% % % % % % % % % % % % % % % % % % % % % % % % % % % % % % %
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment