lyc102 / ifem

iFEM is a MATLAB software package containing robust, efficient, and easy-following codes for the main building blocks of adaptive finite element methods on unstructured simplicial grids in both two and three dimensions.
https://lyc102.github.io/ifem/
GNU General Public License v3.0
185 stars 73 forks source link

The extraction of MATLAB version #9

Closed David-Hang-Du closed 1 year ago

David-Hang-Du commented 1 year ago

Some MATLAB version has "Update #" at the end, which results in wrong extraction of version number. This change uses parentheses to locate the year.

scaomath commented 1 year ago

@David-Hang-Du Another comment is that extractBetween was introduced in R2016b, which defeats the purpose of this version check that handles the legacy switch starting circa R2013. If you can use regexp to do it that would be much better.

For example:

matlabversion = version;
startIndex = regexp(version,'(')+1;
endIndex = regexp(version, ')')-1;
matlabversion = matlabversion(startIndex:endIndex);
David-Hang-Du commented 1 year ago

regexp

Yes, "regexp" is much better. Thank you.

scaomath commented 1 year ago

regexp

Yes, "regexp" is much better. Thank you.

You can commit another change to your branch, it will be included automatically in this PR if you do after the commit message.

git push -f origin HEAD

Then I will squash the commits into one.