You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I tried to train a STRM on some localizer trials, and apply the trained STRM on main trials of interest. However, i kept getting the error below while running tudadecode.m.
The error can be reproduced by evaluating the code below (the majority of code is copy-pasted from examples/STRM.m so I'd assume that the tudatrain.m is properly set up.
% ================== COPY-PASTE FROM `STRM.M` EXAMPLE STARTS =====================
%% PART ONE: Simulations for STRM-Classification model:
clear all;
rng(1);
P = 2; % number of data dimensions
Q = 2; % number of classes
K = 2; % number of latent states
T = 50; % number of timepoint in each trial
N = 20; % number of trials
% generate state timecourses:
z = zeros(N*T,K);
for itrial = 1:N
transtime = rand(1)*48 + 1;
t_offset = (itrial-1)*T;
z(t_offset + [1:floor(transtime)],1)=1;
z(t_offset + [ceil(transtime):T],2)=1;
end
cols = {[1 0 0],[0 1 0]}
% generate each class activation patterns and covariance matrices:
for ik=1:K
W{ik} = randn(P+1,Q);
Sigma{ik} = 0.5*wishrnd(eye(P),P);
end
% generate design matrices:
DM = [ones(N*T,1),[ones(N*T/2,1);zeros(N*T/2,1)],[zeros(N*T/2,1);ones(N*T/2,1)]];
% generate data itself:
data = zeros(N*T,P);
for itrial=1:N
t_offset = (itrial-1)*T;
for iT = 1:T
data(t_offset+iT,:) = mvnrnd(DM(t_offset+iT,:)*W{find(z(t_offset+iT,:),1)},Sigma{find(z(t_offset+iT,:),1)});
end
end
options = [];
options.K = K;
options.encodemodel = true; % this activates the STRM model
options.intercept = true;
options.covtype = 'full';
[STRMmodel,STRMstates] = tucatrain(data,DM(:,2:3),repmat(T,N,1),options);
% ================== COPY-PASTE FROM `STRM.M` EXAMPLE ENDS =====================
% decode
[Gamma,vpath] = tudadecode(data,DM,repmat(T,N,1),STRMmodel);
and the error message I get (in matlab2020b) looks like this:
I'm not sure if I had missed something in the pipeline, or it is something wrong with the sub-functions called by tudadecode?
Thanks in advance for your help!
The text was updated successfully, but these errors were encountered:
I tried to train a STRM on some localizer trials, and apply the trained STRM on main trials of interest. However, i kept getting the error below while running
tudadecode.m
.The error can be reproduced by evaluating the code below (the majority of code is copy-pasted from
examples/STRM.m
so I'd assume that thetudatrain.m
is properly set up.and the error message I get (in matlab2020b) looks like this:
I'm not sure if I had missed something in the pipeline, or it is something wrong with the sub-functions called by
tudadecode
?Thanks in advance for your help!
The text was updated successfully, but these errors were encountered: