You're on the right track, but you're still returning just the vector X_Adptive from your Adaptive module. When you create the list P1 in that module, you need to include X_Adptive as an element of the list (in addition to T and q) and then return P1:
P1 = [ X_Adptive, T, q];
return P1;
And later on, note that when you call the Adaptive module, you access elements of the returned list like this:
adaptiveRes = Adaptive(X,m1,K,theta1);
X_ADP = adaptiveRes$1;
T = adaptiveRes$2;
q = adaptiveRes$3;
I would also recommend reviewing the use of named lists in the above linked blog post. In the examples above, you can see I'm extracting list items using their positions (i.e., adaptiveRes$1 is the first item of the list). However, giving list items names can improve code readability. For example, in your case, you could name your list items 'X_Adaptive', 't', and 'q', and then extract those by name rather than position.
... View more