cwEPR App for processing, simulating, and fitting CW EPR data

Programs, scripts and GUIs shared by EasySpin users
ThomasMCasey
User
Posts: 34
Joined: Tue May 26, 2015 1:50 pm

cwEPR App for processing, simulating, and fitting CW EPR data

Post by ThomasMCasey »

MathWorks File Exchange: https://www.mathworks.com/matlabcentral ... 3292-cwepr

This app implements all of the CW EPR simulation functions, many of the relevant data processing functions, and esfit of easyspin. Additional features include:

  • "Quantify" tab for converting a double-integral value to a spin concentration

  • Narrow the fit region in esfit

  • Option to display the x axis as g values rather than field

  • Slider for adjusting frequency to account for inaccurate field controllers

  • Easily switch between fitting slices of 2D data sets individually, in parallel, or in series

Make sure to look through the manual before you get started. Please report any bugs, suggestions, or feature requests.

cwEPR.png
cwEPR.png (211.65 KiB) Viewed 20266 times
Last edited by ThomasMCasey on Sun May 14, 2023 7:13 am, edited 2 times in total.
katarkon
Local Expert
Posts: 186
Joined: Mon Jan 12, 2015 4:01 am

Re: cwEPR App for processing, simulating, and fitting CW EPR data

Post by katarkon »

I tried to install your application, but it does not start and throwa an error.
Error using nargout
Function cwEPR does not exist.

Error in cwEPRApp/startApp (line 42)
if nargout(@cwEPR) == 0

Error in cwEPRApp (line 21)
startApp(obj)

Error in appinstall.internal.runapp>execute (line 29)
out = evalin('caller', [script ';']);

Error in appinstall.internal.runapp (line 8)
appobj = execute(runcommand);


I use MatLab R2012b on Windows 7 x64 system.
ThomasMCasey
User
Posts: 34
Joined: Tue May 26, 2015 1:50 pm

Re: cwEPR App for processing, simulating, and fitting CW EPR data

Post by ThomasMCasey »

It appears that this happens when trying to install an app created in matlab versions 2013+ using matlab 2012 or older due to a change in the 'evalin' function. The official response from the mathworks support team can be found here:

https://www.mathworks.com/matlabcentral ... wer_113188

It looks like the advice is to just try again. If it still doesn't work let me know and I can find another way to share it with you or anyone running older versions.
katarkon
Local Expert
Posts: 186
Joined: Mon Jan 12, 2015 4:01 am

Re: cwEPR App for processing, simulating, and fitting CW EPR data

Post by katarkon »

I have tried to reinstall the program. The results were the same, unfortunately. I'll try to use more recent version of MATLAB.
bruin
User
Posts: 23
Joined: Fri May 29, 2020 11:07 am

Re: cwEPR App for processing, simulating, and fitting CW EPR data

Post by bruin »

The GUI looks great. Data processing and simulation works intuitively. Nice!
With fitting I have more problems.
Probably a stupid question, but how can I use this GUI for fitting? Do you have a bit more info in the manual?
Whatever I try with fitting, I always get this error message:

Error using esfit
First input parameter must be a valid function name or function handle.

Error in cwEPR/esfit (line 4168)
esfit('custom_fittwomethods',spc(:,app.currslice),Sys,Vary,Exp,Opt,FitOpt)
Error using matlab.ui.control.internal.controller.ComponentController/executeUserCallback (line 335)
Error while evaluating Button PrivateButtonPushedFcn.

(Using cwEPR version 2.6, Easyspin 5.2.28 and Matlab 9.7.0.1319299 (R2019b) Update 5)
ThomasMCasey
User
Posts: 34
Joined: Tue May 26, 2015 1:50 pm

Re: cwEPR App for processing, simulating, and fitting CW EPR data

Post by ThomasMCasey »

Hi bruin,

Thank you, I'm glad it is helpful for you! And thank you for the feedback!

Do you have the folder "helper_functions" on your path? It should be in the .zip file that you downloaded. It looks like it can't find the function 'custom_fittwomethods' that is needed for the fitting. I may be able to find a way to put these "helper" functions into the app itself so it doesn't need to look elsewhere but at this point it needs these external functions.

If you do have them on your path and still get this or other errors, can you 'Save Parameters' under the Tools tab and attach the .mat file here?
bruin
User
Posts: 23
Joined: Fri May 29, 2020 11:07 am

Re: cwEPR App for processing, simulating, and fitting CW EPR data

Post by bruin »

That did the trick! Thanks!
(had my path defined to the cwEPR v2.6 folder, but not to the helper functions specifically).
Now it works. Great.
ThomasMCasey
User
Posts: 34
Joined: Tue May 26, 2015 1:50 pm

Re: cwEPR App for processing, simulating, and fitting CW EPR data

Post by ThomasMCasey »

Ok, great! No problem!
Stefan Stoll
EasySpin Creator
Posts: 1050
Joined: Mon Jul 21, 2014 10:11 pm
Location: University of Washington

Re: cwEPR App for processing, simulating, and fitting CW EPR data

Post by Stefan Stoll »

Nice UI!
Alejandro
Newbie
Posts: 1
Joined: Fri Jul 31, 2020 8:03 am

Re: cwEPR App for processing, simulating, and fitting CW EPR data

Post by Alejandro »

Hello Friends!
Thank you for your work!
I want to use the app for my research, but when I try to run the app, the window is "chopped" and I cannot see the upper part (when the load file button should be). This could be solved by resizing the window to see all the info on the screen, but the app doesn't let to do that. I have the latest version of Mathlab (2019b update 6)

Thanks in advance

Correction
I got it guys
I resized my display to show all the elements smaller and now it's working

Thanks
Post Reply