Airspace-Encounter-Models / em-model-manned-bayes

Manned Bayesian Network Encounter Models
BSD 2-Clause "Simplified" License
14 stars 7 forks source link

[ENHANCEMENT] Alternative for "combvec" for users who do not have access to neural network toolbox #5

Closed mes958 closed 3 years ago

mes958 commented 4 years ago

Instructions

Read the instructions and fill out your responses at the bottom.

Relation

Is your feature request related to a problem? Please describe. Please provide a clear and concise description of what the problem is. Ex. I'm always frustrated when [...]

Description

A clear and concise description of what you want to happen.

Alternatives

A clear and concise description of any alternative solutions or features you've considered.

Additional context

Add any other context or screenshots about the feature request here.

FILL ME OUT

Relation

The program uses a function "combvec" which is only available through the Neural Network Toolbox, which I do not have access to with my student Matlab license. If combvec does not work, the program cannot function.

Description

A work-around to be implemented using a function that does not require a toolbox.

Alternatives

I used a function called "allcomb" from file exchange: https://www.mathworks.com/matlabcentral/fileexchange/10064-allcomb-varargin

It seems to work as expected in Matlab R2019b.

Additional

The problem is on line 158 of the sample2track.m function.

Thank you!

aweinert-MIT commented 3 years ago

I added a warning to RUN_2_sample2track.m about the toolbox dependency and how to use allcomb as an alternative.

I'm hesitant to add allcomb as a dependency to em-model-manned-bayes, as allcomb could be a better fit for em-core. I'll keep this issue open for awareness and until we have a longer term solution in place.


%% Warn about Matlab toolbox
product_info = ver;
if ~any(strcmpi({product_info.Name},'Deep Learning Toolbox')) && ~any(strcmpi({product_info.Name},'Neural Network Toolbox'))
    warning('toolbox:combvec',sprintf('sample2track() uses combvec(), a function from the MATLAB Deep Learning or Neural Network Toolbox\nAn alternative is to use allcomb from file exchange:https://www.mathworks.com/matlabcentral/fileexchange/10064-allcomb-varargin\nReplace GAL = combvec(G'',A'',L'')''; with GAL = allcomb(G,A,L);''\n'));
end
aweinert-MIT commented 3 years ago

allcomb has been added em-core and integrated into em-model-manned-bayes with #17