Page 1 of 1

Error using pepper! Please help!

Posted: Sun Nov 15, 2015 7:20 pm
by lkrishna
Hi,
I'm new to matlab and easyspin software.
I was running this code:
Sys.g = [ 2.08 2.085];
Sys.lwpp = [0.5];
Exp.mwFreq = 9.45;
pepper(Sys,Exp);
And it worked fine. Then I changed a command ----from Sys.lwpp to Sys.lw and this generated an error-
Error using pepper
Sys.lw and Sys.lwpp cannot be used simultaneously.

How do I get rid of this error?
Thanks!

Re: Error using pepper! Please help!

Posted: Mon Nov 16, 2015 8:21 am
by Matt Krzyaniak
This is a common problem for the beginning matlab/easyspin user. When running your script a second time you're adding to the structure Sys so both Sys.lw and Sys.lwpp are present. The remedy for this is to ensure you clear the variables before you run your script, its good practice to start your script with a clear command, or if you have other variables in your workspace that you want to persist you can target the variables with clear Sys Exp
so:

Code: Select all

clear
Sys.g = [ 2.08 2.085];
Sys.lwpp = [0.5];
Exp.mwFreq = 9.45;
pepper(Sys,Exp);

Re: Error using pepper! Please help!

Posted: Mon Nov 16, 2015 10:47 am
by lkrishna
Hi Matt!
That worked great! Thanks you so much. I have few more questions:
1. Is there any way I can have my experimental ESR and simulated spectrum in the same window and vary fitting parameters so that I can see how good the fit is?
2. When I'm running the code in the previous post, I tried to expand the x-axis. I could do that but after every run it will go back to previous setting.
Thanks again for helping!
Lakshmi