Skip to content

Instantly share code, notes, and snippets.

View awade's full-sized avatar

Andrew Wade awade

  • The Australian National University
  • Canberra, Australia
View GitHub Profile
@awade
awade / RG58_loss.m
Created March 12, 2021 04:30
Matlab helper function for interpolating loss of coaxial RG58 cable as function of frequency per unit length.
function dBLossPerM = RG58_loss(f)
% Function for estimate RG58 coaxial cable loss as a function of frequency
% per meter. Data is drawn from https://www.w4rp.com/ref/coax.html and is
% not varified with real lab measurments. Take it with a
% grain of salt.
%
% Output interpolates from the spaced data points. This is for estimating
% only.
%
% Author: Andrew Wade
@awade
awade / randomUnitVectors.m
Created May 26, 2021 06:56
Some Matlab code for generating random normal vectors uniformly distributed in angle
%% First a method using quaternions
qtn = randrot(1000,1);
pts = rotatepoint(qtn, [1 0 0]);
figure()
scatter3(pts(:,1), pts(:,2), pts(:,3))
axis equal