Using function of newer MATLAB version in older version

조회 수: 36 (최근 30일)
Nicolas Bourbaki
Nicolas Bourbaki 2022년 2월 20일
편집: John D'Errico 2022년 2월 20일
Hello everybody out there using MATLAB,
The functions wrap and unwrap have been added to MATLAB in 2021.
Is there a way to add the code for these functions to older versions of MATLAB in order to enable people with older versions of MATLAB to use my code?
I assume that the code of the functions is not too complex and they are rather provided for convenience.

답변 (2개)

John D'Errico
John D'Errico 2022년 2월 20일
편집: John D'Errico 2022년 2월 20일
No. Sorry, but no. You cannot use functions from one release in another release. They essentially check for this.
Could you write codes with those names, adding them to your own toolboxes? Well, yes. But then you would need to write the code yourself.
Having said that, I know that unwrap has certainly been around for ages. A quick check tells me it was introduced before 2006a. So at least 16 years ago, and I recall it before then.
As far as wrap goes, it does not exist in MATLAB R2020b, then I checked R2021a. Not in there either. I guess this means it is time to install a new release for me. Ok. Checked. wrap does also not exist in R2021b, update 2, either. So unless you have this toolbox:
which wrap -all
/MATLAB/toolbox/matlab/testframework/unittest/core/+matlab/+unittest/+internal/+diagnostics/FormattableString.m % matlab.unittest.internal.diagnostics.FormattableString method /MATLAB/toolbox/matlab/testframework/unittest/core/+matlab/+unittest/+internal/+diagnostics/LeafFormattableString.m % Shadowed matlab.unittest.internal.diagnostics.PlainString method
then you will not have wrap. Are you a wrapper? Is it my birthday already? ;-)
  댓글 수: 1
John D'Errico
John D'Errico 2022년 2월 20일
편집: John D'Errico 2022년 2월 20일
@Nicolas Bourbaki - Please don't post an answer just to make a comment. Comment moved here:
The task I hope to solve with the wrap function is rather simple:
I would like to interpolate timeseries of angles in degree:
An interpolation between 359° and 2° should yield 1° and not 180.5°.
Thanks for your hint about finding the location of a function via which wrap -all:
C:\Program Files\MATLAB\R2021a\toolbox\shared\reqmgt\+slreq\+data\@ReqData\wrap.p % slreq.data.ReqData method

댓글을 달려면 로그인하십시오.


Sean de Wolski
Sean de Wolski 2022년 2월 20일
Sounds like you might be looking for wrapTo360 et al. in Mapping Toolbox:

카테고리

Help CenterFile Exchange에서 Get Started with MATLAB에 대해 자세히 알아보기

제품


릴리스

R2018b

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by