The error is not like I first expected due to the epoching with an incomplete last epoch.
It seems the be originating from a not strictly uniform timevector. Does Brainstorm support this?
Otherwise its completely fine for me to resample my data to a uniform time.
Example data can be generated with the following script:
%% Data Generation Scripts for out_fwrite_bst.m error
Fs =10e3;
data=[];
NCH = 32;
T_sig = 1.1234;
sig = rand(NCH,Fs*T_sig);
data.label = cellstr(string(1:NCH)); % cell-array containing strings, Nchan*1
data.fsample = Fs; % sampling frequency in Hz, single number
data.trial{1} = sig; % cell-array containing a data matrix for each trial (1 X Ntrial), each data matrix is a Nchan*Nsamples matrix
FT_Error ='working';
switch FT_Error
case 'working'
data.time{1} =(0:(length(sig))-1)./Fs; % cell-array containing a time axis for each
case 'error'
data.time{1} =(0:(length(sig)))./Fs; % cell-array containing a time axis for each
data.time{1}(99) = [];
end
data.sampleinfo=[1,length(sig)];
data.label = data_ft.label;
save('./Test_FT.mat', 'data')
best, Dominik