Skip to content
Snippets Groups Projects
Commit 50b3fdf3 authored by Laura Nervo's avatar Laura Nervo
Browse files

Small formatting fixing...


Signed-off-by: default avatarLaura Nervo <laura.nervo@esrf.fr>
parent 87023b08
No related branches found
No related tags found
No related merge requests found
...@@ -56,7 +56,7 @@ elseif isnumeric(mode) ...@@ -56,7 +56,7 @@ elseif isnumeric(mode)
elseif ischar(mode) && strcmp(mode, 'diag') elseif ischar(mode) && strcmp(mode, 'diag')
if M ~= N if M ~= N
gtError('gtVectorCryst2Lab:wrong_mode', ... gtError('gtVectorCryst2Lab:wrong_mode', ...
['''diag'' mode needs as many vectors as matrices!']); '''diag'' mode needs as many vectors as matrices!');
end end
diag = true; diag = true;
else else
...@@ -113,7 +113,7 @@ elseif M > 1 && N > 1 ...@@ -113,7 +113,7 @@ elseif M > 1 && N > 1
Vc = reshape(Vc.', [3 1 1 M]); Vc = reshape(Vc.', [3 1 1 M]);
% Multiply and sum along 1st axis to reproduce Vs = Vc . g % Multiply and sum along 1st axis to reproduce Vs = Vc . g
Vs = permute(squeeze(sum(bsxfun(@times, Vc, g), 1)), [mode]); Vs = permute(squeeze(sum(bsxfun(@times, Vc, g), 1)), mode);
else else
gtError('gtVectorCryst2Lab:wrong_input_size', ... gtError('gtVectorCryst2Lab:wrong_input_size', ...
......
function sublist = gtSubList(list, varargin) function sublist = gtSubList(list, varargin)
% GTSUBLIST Creates sub-list to give to gtModifyStructure
% sublist = gtSubList(list, varargin)
% -----------------------------------
% based on a list created using make_parameters / build_list,
% make a sublist suitable for gtModifyStructure, containing only the
% requested fields.
% %
% based on a list created using make_parameters / build_list, % input, for example: gtSubList(list.acq, 'name', 'dir', energy')
% make a sublist suitable for gtModifyStructure, containing only the % output: sublist, a 3x2 cell for gtModifyStructure
% requested fields.
%
% input, for example: gtSubList(list.acq, 'name', 'dir', energy')
% output: sublist, a 3x2 cell for gtModifyStructure
% preallocate sublist % preallocate sublist
sublist=cell(length(varargin), 2); sublist=cell(length(varargin), 2);
for i=1:length(varargin) for ii=1:length(varargin)
ndx=find(strcmp(list(:,1), varargin{i})); ndx=find(strcmp(list(:,1), varargin{ii}));
if ~isempty(ndx) if ~isempty(ndx)
sublist{i,1}=list{ndx, 1}; sublist{ii,1}=list{ndx, 1};
sublist{i,2}=list{ndx, 2}; sublist{ii,2}=list{ndx, 2};
else else
disp(sprintf('problem with input to gtSubList - field name %s not found in main list', varargin{i})) disp(['problem with input to gtSubList - field name ' varargin{ii} ' not found in main list'])
end end
end end
\ No newline at end of file
end % end of function
function [parameters, list] = make_parameters(version) function [parameters, list] = make_parameters(version)
% MAKE_PARAMETERS Create a parameters.mat file with empty fields % MAKE_PARAMETERS Create a parameters.mat file with empty fields
% [parameters, list] = make_parameters(version,debug) % [parameters, list] = make_parameters(version)
% --------------------------------------------------- % ---------------------------------------------
% %
% INPUT: % INPUT:
% version = -1 (load a specific .mat file) % version = -1 (load a specific .mat file)
...@@ -18,26 +18,25 @@ function [parameters, list] = make_parameters(version) ...@@ -18,26 +18,25 @@ function [parameters, list] = make_parameters(version)
% Creates a .mat file with description for each field in the parameters.mat to be used with gtModifyStructure.m % Creates a .mat file with description for each field in the parameters.mat to be used with gtModifyStructure.m
% %
disp('Getting the field list of parameters...') disp('Getting the field list of parameters...')
switch (version) switch (version)
case -1 case -1
filename = inputwdefault('Insert filepath of the mat file to load', ... filename = inputwdefault('Insert filepath of the mat file to load', ...
'./parameters.mat'); './parameters.mat');
pars = load(filename, 'parameters'); pars = load(filename, 'parameters');
pars = pars.parameters; pars = pars.parameters;
list = complete_structure(pars, [], true, '__'); list = complete_structure(pars, [], true, '__');
parameters = build_structure(list, '__'); parameters = build_structure(list, '__');
case 0 case 0
list = build_list_v0(); list = build_list_v0();
parameters = build_structure(list, '__'); parameters = build_structure(list, '__');
case 1 case 1
list = build_list_v1(); list = build_list_v1();
parameters = build_structure(list, '__'); parameters = build_structure(list, '__');
case 2 case 2
list = build_list_v2(); list = build_list_v2();
parameters = build_structure(list, '__'); parameters = build_structure(list, '__');
parameters.version.number = 2; parameters.version.number = 2;
end end
end % end of function
end % end of function
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment