Hi Antonio,
Sorry for the response delay.
The frequency is selected in function out_matrix_ascii.m:
if (size(R,3) > 1)
error('Cannot export connectivity matrices that are changing both in time and frequency.');
end
% Transfer frequency dimension to 3rd dimension
R = permute(R, [1 2 4 3]);
end
% Save it to a file
out_matrix_ascii(OutputFile, R, FileFormat, TimefreqMat.RefRowNames, TimefreqMat.RowNames, LabelFreq, '\');
% Time-frequency / spectrum
else
out_matrix_ascii(OutputFile, TimefreqMat.TF, FileFormat, TimefreqMat.RowNames, TimefreqMat.Time, LabelFreq);
end
otherwise
error(['Unsupported file extension : "' OutputExt '"']);
end
% Hide progress bar
bst_progress('stop');
end
% If there is a third dimension and not a second one (freq but no time): switch
if ((size(Data,2) == 1) || ((size(Data,2) == 2) && isequal(Data(:,1,:,:), Data(:,2,:,:)))) && (size(Data,3) > 1)
Data = permute(Data, [1,3,2]);
Label2 = Label3;
Label3 = [];
Title2 = 'Freq';
% If there are too many dimensions, and not saving in XLSX, select which one
elseif (size(Data,3) > 1) % && ~strcmpi(FileFormat, 'EXCEL')
% Ask user what entry to export
selLabel = java_dialog('combo', 'Select the frequency to export:', 'Export to ASCII', [], Label3);
if isempty(selLabel)
return
end
% Get the index of the selected frequency
iFreq = find(strcmpi(Label3, selLabel));
if (length(iFreq) ~= 1)
error('Unknown error...');
end
% Select only that one
Data = Data(:,:,iFreq);
If this gets asked, it is because you have multiple frequency bands in your TF file, and it cannot be save in a flat 2D matrix. You could do the frequency selection yourself, and call out_matrix_ascii from your code directly.
Cheers,
Francois