mparkan / Digital-Forestry-Toolbox

A collection of digital forestry tools for Matlab/Octave
http://mparkan.github.io/Digital-Forestry-Toolbox/
GNU General Public License v3.0
46 stars 16 forks source link

LASWrite requires Statistics and Machine Learning Toolbox #8

Closed ghost closed 3 years ago

ghost commented 4 years ago

When running LASWrite.m, it throws an error on line 2116 if the Statistics and Machine Learning is not installed.

Add a check for that toolbox and if it doesn't exist, use an alternate method to determine the equal lengths of the point data records:

if license('test','statistics_toolbox')
    if ~(range(n_records_per_attribute) == 0)
        error('LASwrite:unequalRecordLengths', 'The lengths of point data records are unequal');
    end
else
    if ~(max(n_records_per_attribute)-min(n_records_per_attribute) == 0)
        error('LASwrite:unequalRecordLengths', 'The lengths of point data records are unequal');
    end
end
mparkan commented 3 years ago

Thanks for reporting. I removed the dependency to the "Statistics and Machine Learning" toolbox.