Hi Chaoning
So I see a couple of problems with your code:
function V = uq_disp(X,H) E1=X(1);E2=X(2); E=[E1,E2]; MaxT=size(H,1); %output = zeros(2,MaxT); for tt=1:MaxT output(:,tt) = dipstatic(E,H(tt,:)); %the function to calculate the displacement end V=output; %the output is an 1*Nout matrix end
- You specify in the the
ModelOpts
structure that your model is vectorized, which it clearly is not. Please setModelOpts.isVectorized = false
or modify your functionuq_disp
to accept vectorized \mathbf{X} - Are you sure your output is a 1\times N_{\mathrm{out}} row vector? It looks like it has two rows.
Let me know how it goes!