How could I do the Percentage of Change on Source data?

Dear Brainstorm Experts:

How could I do the Percentage of Change on Source data?
Due to that, I would understand the Percentage of Change on Source data between the ASD and TD.
As follows:

TD = Typical Group Source data
ASD = Autism Group Source data

Diff_1=ASD_1 -mean|TD|
Diff_2=ASD_2 -mean|TD|

Diff_N=ASD_N -mean|TD|
Sum_of_Diff = Diff_1+Diff_2+⋯+Diff_N
Percentage of Change (%)=
[ ((Sum_of_Diff)/N) / mean|TD| ]×100%

Thank you very much.

For all the measures you would like to apply on your data that you can't find in the list of processes (particularly in the Pre-process menu), you can write your own Matlab scripts.

Various solutions are illustrated in this tutorial (requires some familiarity with the Matlab programming language):
https://neuroimage.usc.edu/brainstorm/Tutorials/Scripting

Dear Francois:

Thanks for your response.
However, I still have some problems writing the script of a percentage of change data on the brainstorm interface.
I have tried my best as follows, but I don't know it is correct or not.
Would you help me to check the process?
Thank you very much.

1
2
3
4

I put the 'results_PercentageChangeC1.mat' file back to the folder to show the source results.
I attached the process files on the link:
https://drive.google.com/drive/folders/1KfaheLmLRwMdm-C5dSiAjHjyLVBFX5sv?usp=sharing
Thank you very much!

For making it easier to manipulate file structures, use the syntax:

FileMat = load('filename.mat');
FileMat.field = newvalue;
save('filename.mat', '-struct', 'FileMat');

Or directly using the load/save function from Brainstorm, as illustrated in the examples of the Scripting tutorial (start by reading this, it may help you a lot):
https://neuroimage.usc.edu/brainstorm/Tutorials/Scripting