forked from I-STAR/SPEKTR
-
Notifications
You must be signed in to change notification settings - Fork 0
/
spektrMeanEnergy.m
41 lines (37 loc) · 1.23 KB
/
spektrMeanEnergy.m
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
function meanEnergy = spektrMeanEnergy(q)
%%**************************************************************************
%% System name: SPEKTR
%% Module name: spektrMeanEnergy.m
%% Version number: 3
%% Revision number: 00
%% Revision date: 15-Mar-2004
%%
%% 2016 (C) Copyright by Jeffrey H. Siewerdsen.
%% I-STAR Lab
%% Johns Hopkins University
%%
%% Usage: meanEnergy = spektrMeanEnergy(q)
%%
%% Input Parameters: 'q' is an X-Ray Energy Spectrum (is a [150 x 1] matrix), generated
%% from the function spektrSpectrum(..,..).
%%
%% ie. h = spektrMeanEnergy(spektrSpectrum(100));
%%
%% Output Parameters: Mean Energy [keV]
%%
%% Description:
%% The function returns the mean energy of the x-ray spectra
%%
%% Notes:
%%
%%*************************************************************************
%% References:
%%
%%*************************************************************************
%% Revision History
%% 0.000 2003 05 01 AW Initial code
%% 1.000 2004 03 15 DJM Initial released version
%%*************************************************************************
%%
q = q(:);
meanEnergy = ([1:150]*q)/sum(q);