Page 1 of 1

Issue with levelsplot with Matlab R2016a

Posted: Wed Apr 13, 2016 2:23 am
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.

Re: Issue with levelsplot with Matlab R2016a

Posted: Thu Apr 14, 2016 5:10 pm
by Stefan Stoll
The last input argument to levelsplot should be a structure:

Code: Select all

Opt.nPoints=10000;

Re: Issue with levelsplot with Matlab R2016a

Posted: Fri Apr 15, 2016 1:21 am
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.

Re: Issue with levelsplot with Matlab R2016a

Posted: Fri Apr 15, 2016 2:29 pm
by Stefan Stoll
I see where the confusion came from. In the next version, we will include a proper error message.