Issue with levelsplot with Matlab R2016a

A place to report and discuss potential bugs
Post Reply
thanasis
Local Expert
Posts: 240
Joined: Thu Jan 21, 2016 6:28 am
Location: Strasbourg

Issue with levelsplot with Matlab R2016a

Post by thanasis »

When using levelsplot with ES 5.0.20 I get two different behaviours depending on the version of Matlab I use, for the same piece of code:

I invoke levelsplot in a rather straightforward manner: I previously define my Sys structure and the experimental details (among which the orientation cori and frequency Exp.mwFreq, and then I just instruct:

Code: Select all

Ori=cori; FieldRange=[0 1500]; Freq=Exp.mwFreq; nPoints=10000; levelsplot(Sys1,Ori,FieldRange,Freq,nPoints);
The two behaviours I get are:

Matlab R2015a
I get a warning:
Warning: Struct field assignment overwrites a value with class "double". See MATLAB R14SP2 Release Notes, Assigning Nonstructure Variables As Structures Displays Warning, for
details.
> In levelsplot (line 63)
In full_sim_single_crystal_isosceles_AE (line 64)
However, the calculation goes on and the plot completes.

Matlab R2016a
I get an error:
Field assignment to a non-structure array object.
Error in levelsplot
Error in full_sim_single_crystal_isosceles_AE (line 64)
Ori=cori; FieldRange=[0 1500]; Freq=Exp.mwFreq; nPoints=10000; levelsplot(Sys1,Ori,FieldRange,Freq,nPoints); %For
levelsplot
The calculation stops.

The code has been uploaded from one computer to another without any changes, so I guess there is an issue with the new version of Matlab.
Stefan Stoll
EasySpin Creator
Posts: 1047
Joined: Mon Jul 21, 2014 10:11 pm
Location: University of Washington

Re: Issue with levelsplot with Matlab R2016a

Post by Stefan Stoll »

The last input argument to levelsplot should be a structure:

Code: Select all

Opt.nPoints=10000;
thanasis
Local Expert
Posts: 240
Joined: Thu Jan 21, 2016 6:28 am
Location: Strasbourg

Re: Issue with levelsplot with Matlab R2016a

Post by thanasis »

Thanks for pointing this out!
Using:

Code: Select all

Par.nPoints = 10000;
and invoking levelsplot as

Code: Select all

levelsplot(Sys1,Ori,FieldRange,Freq,Par);
did the trick.

The different behaviour between the two Matlab versions gave me the false impression it was a bug.
Stefan Stoll
EasySpin Creator
Posts: 1047
Joined: Mon Jul 21, 2014 10:11 pm
Location: University of Washington

Re: Issue with levelsplot with Matlab R2016a

Post by Stefan Stoll »

I see where the confusion came from. In the next version, we will include a proper error message.
Post Reply