diff --git a/utilities/housekeeping/pb_clean.m b/utilities/housekeeping/pb_clean.m index 4ca0ddcbed3009efb8ec852f8ab881c7dd651c5c..0d23ee04e51abe3175d739cdad4695b8e03fb656 100644 --- a/utilities/housekeeping/pb_clean.m +++ b/utilities/housekeeping/pb_clean.m @@ -12,10 +12,6 @@ function pb_clean(varargin) empty = pb_keyval('clc',varargin,true); clr = pb_keyval('clr',varargin,true); - if ~islogical(clr) - disp('hi') - end - if fig; close all; end if empty; clc; end if islogical(clr) diff --git a/utilities/math/pb_rot2azel.m b/utilities/math/pb_rot2azel.m new file mode 100644 index 0000000000000000000000000000000000000000..b24a7fa92953cc31a783c270621816d46441ab2e --- /dev/null +++ b/utilities/math/pb_rot2azel.m @@ -0,0 +1,28 @@ +function [az,el] = pb_rot2azel(x,y,z) +% PB_ROT2AZEL +% +% PB_ROT2AZEL(x,y,z) returns the azimuth and elevation +% +% See also ... + +% PBToolbox (2019): JJH: j.heckman@donders.ru.nl + + if (nargin==1 && size(x,2)==3) + y=x(:,2); + z=x(:,3); + x=x(:,1); + end + + RTD = 180/pi; + p = sqrt(x .* x + z .* z); + az = RTD * atan2 (x, sqrt (y.^2 + z.^2)); + el = RTD * atan2(y,z); +end + +% % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % +% % +% Part of Programmeer Beer Toolbox (PBToolbox) % +% Written by: Jesse J. Heckman (2019) % +% % +% % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % +