Error using pepper! Please help!

General forum for EasySpin: questions, how to's, etc.
Post Reply
lkrishna
Newbie
Posts: 9
Joined: Sun Nov 15, 2015 7:14 pm

Error using pepper! Please help!

Post 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!
Matt Krzyaniak
EasySpin Guru
Posts: 153
Joined: Tue Jul 22, 2014 11:01 am
Location: Northwestern University

Re: Error using pepper! Please help!

Post 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);
lkrishna
Newbie
Posts: 9
Joined: Sun Nov 15, 2015 7:14 pm

Re: Error using pepper! Please help!

Post 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
Post Reply