From a3ce0388dc2d9d3ec066baba3ae0451724612447 Mon Sep 17 00:00:00 2001 From: Jesse Heckman Date: Wed, 12 Jun 2019 12:32:56 +0200 Subject: [PATCH] minor fixes --- utilities/housekeeping/pb_clean.m | 4 ---- utilities/math/pb_rot2azel.m | 28 ++++++++++++++++++++++++++++ 2 files changed, 28 insertions(+), 4 deletions(-) create mode 100644 utilities/math/pb_rot2azel.m diff --git a/utilities/housekeeping/pb_clean.m b/utilities/housekeeping/pb_clean.m index 4ca0ddc..0d23ee0 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 0000000..b24a7fa --- /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) % +% % +% % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % + -- GitLab