MATLAB version 2018b provides a different exception identifier for the same situation than version 2017b did. Can you suggest the easiest way to handle this that works for both versions?
3 views (last 30 days)
Show older comments
Marta on 24 Sep 2018
Commented: Walter Roberson on 24 Sep 2018
% this same bit of code causes the identifier "MATLAB:imagesci:h5info:unableToFind"
% is there a better way to catch this exception that will work for both versions?
IMUstring = '/Nav_Data/'; % does this group exist in the hdf5 file?
catch err % No, so check for this group instead
catch err % Not that group. One last option
IMUstring = '/ApplanixIMU/';
catch err % out of options. Alert the user to problem
error('problem identifying IMU in use. Did you give the correct filename?')
Fangjun Jiang on 24 Sep 2018
You didn't identify other errors. Is it necessary to identify this error, or you just simply need to catch an errors.
Anyway, I had to use version() or verLessThan() a few times to make my script working in different versions of MATLAB.
More Answers (0)
Find more on Startup and Shutdown in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!Start Hunting!