-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathfindcombos.m
More file actions
25 lines (25 loc) · 963 Bytes
/
Copy pathfindcombos.m
File metadata and controls
25 lines (25 loc) · 963 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
% function [combos] = findcombos(selectedsites,nmax)
%--------------------------------------------------------------------------
% Jade Crosbie kcrosbie@usgs.gov
% Geology, Geophysics, and Geochemistry Science Center
% U.S. Geological Survey
% Created: Oct 10 2020
% Updated: Jan 6 2020
% MATLAB version: 2019b
%--------------------------------------------------------------------------
% Computes an array of indices to find all combinations of stations for MMT
% INPUT
% selectedsites = Structure from ArrayManager with metadata like station
% names
% nmax = max number for station combos, reccommend nmax = 5.
% OUTPUT
% combos = Array with indices for all combos of selected sites.
function [combos] = findcombos(selectedsites,nmax)
ii = 2;
ik = 1;
while ii <= nmax
combos{ik} = nchoosek([1:length(selectedsites)],ii)
ii = ii + 1;
ik = ik + 1;
end
end