Removed use of mustBeMember since it doesn't exist in Octave

gr-droneid-3.8
David Protzman 2022-04-18 23:51:48 -04:00
rodzic 1d25a33db2
commit 43949eda91
3 zmienionych plików z 16 dodań i 2 usunięć

Wyświetl plik

@ -8,7 +8,7 @@
function [bits] = generate_scrambler_seq(num_bits, x2_init)
assert(isrow(x2_init), "X2 initial value must be a row vector");
assert(length(x2_init) == 31, "The X2 initial value must be 31 bits");
mustBeMember(x2_init, [0, 1]);
must_be_member(x2_init, [0, 1]);
% https://www.sharetechnote.com/html/Handbook_LTE_PseudoRandomSequence.html
% https://edadocs.software.keysight.com/pages/viewpage.action?pageId=6076479

Wyświetl plik

@ -0,0 +1,9 @@
% Replacement for the mustBeMember function that's in MATLAB, but not Octave
%
% Throws an assertion failure if `vector` contains any values not in `valid_values`
%
% @param vector Vector/Matrix of values to check against the list of valid values
% @param valid_values List of value values that can be in any one of the elements of `vector`
function [] = must_be_member(vector, valid_values)
assert(isequal(ismember(vector, valid_values), ones(size(vector))));
end

Wyświetl plik

@ -10,7 +10,12 @@
% - Print out each frame in hex
%% Path Info
this_script_path = fileparts(matlab.desktop.editor.getActiveFilename);
if (is_octave)
this_script_path = fileparts(mfilename('fullpath'));
else
this_script_path = fileparts(matlab.desktop.editor.getActiveFilename);
endif
turbo_decoder_path = fullfile(this_script_path, filesep, '..', filesep, '..', filesep, 'cpp', filesep, 'remove_turbo');
if (~ isfile(turbo_decoder_path))
error("Could not find Turbo decoder application at '%s'. Check that the program has been compiled",...