Rescale function error

General forum for EasySpin: questions, how to's, etc.
Post Reply
thanasis
Local Expert
Posts: 242
Joined: Thu Jan 21, 2016 6:28 am
Location: Strasbourg

Rescale function error

Post by thanasis »

I am running a fit using a custom function. Naturally, after the pepper invocation in the custom function I use a rescale command to rescale the calculated with the experimental y-values.

[x,y] = pepper(fullSys,Exp,Opt);
y_ref = Sys.spc;
y_rescale = rescale(y(:), y_ref(:), 'lsq0');

On a Linux machine running Matlab 2018a it works just fine. On a Windows machine running Matlab 2019a I get the error:

Error using esfit
Error using rescale>preprocessInputs (line 112)
Interval bound arguments must be real and numeric.

Error in esfit_simplex

Error in esfit

Error while evaluating UIControl Callback.

As there is also a Matlab rescale function (https://fr.mathworks.com/help/matlab/ref/rescale.html) I can't tell where the error comes from. I suppose the ES rescale function overrides the Matlab one?

Is there a way to debug this?

Thanks!

Matt Krzyaniak
EasySpin Guru
Posts: 153
Joined: Tue Jul 22, 2014 11:01 am
Location: Northwestern University

Re: Rescale function error

Post by Matt Krzyaniak »

In the development version this has been fixed, the ES function rescale was renamed rescaledata which avoids, as in your case, the other Matlab rescale function.

thanasis
Local Expert
Posts: 242
Joined: Thu Jan 21, 2016 6:28 am
Location: Strasbourg

Re: Rescale function error

Post by thanasis »

Yes that did the trick!

Thank you Matt.

Post Reply