cant get object’s method to return multiple outputs outputs
Hi, i cant get my method to return multiple outputs.
I have my object folder with the classdef
classdef crm < handle
%…
methods (Access = public)
[Tout,Yout]=runTimeDependent(self,n_0,tdata,nedata,Tedata)
end
end
And my function definition in a separate file inside the @crm folder
function [Tout,Yout]=runTimeDependent(self,n_0,tdata,nedata,Tedata)
TSPAN = [tdata(1) tdata(end)];
[Tout,Yout]=ode15s(@odefun,TSPAN,n_0);
function dydt=odefun(t,y)
% … ode function here
end
end
If i build my object and run the method everything works but if i ask 2 outputs i get an error
c=crm();
% definemy parameters ( Y0, t, ne, Te)
c.runTimeDependent(Y0,t,ne,Te); % This line works
[Tout, Yout] = c.runTimeDependent(Y0,t,ne,Te); %this line throws an error
Only when i ask both my outputs do i get an error
Error using indexing
Too many output arguments.
Error in test_timedep (line 4)
[Tout, Yout] = c.runTimeDependent(Y0,t,ne,Te);Hi, i cant get my method to return multiple outputs.
I have my object folder with the classdef
classdef crm < handle
%…
methods (Access = public)
[Tout,Yout]=runTimeDependent(self,n_0,tdata,nedata,Tedata)
end
end
And my function definition in a separate file inside the @crm folder
function [Tout,Yout]=runTimeDependent(self,n_0,tdata,nedata,Tedata)
TSPAN = [tdata(1) tdata(end)];
[Tout,Yout]=ode15s(@odefun,TSPAN,n_0);
function dydt=odefun(t,y)
% … ode function here
end
end
If i build my object and run the method everything works but if i ask 2 outputs i get an error
c=crm();
% definemy parameters ( Y0, t, ne, Te)
c.runTimeDependent(Y0,t,ne,Te); % This line works
[Tout, Yout] = c.runTimeDependent(Y0,t,ne,Te); %this line throws an error
Only when i ask both my outputs do i get an error
Error using indexing
Too many output arguments.
Error in test_timedep (line 4)
[Tout, Yout] = c.runTimeDependent(Y0,t,ne,Te); Hi, i cant get my method to return multiple outputs.
I have my object folder with the classdef
classdef crm < handle
%…
methods (Access = public)
[Tout,Yout]=runTimeDependent(self,n_0,tdata,nedata,Tedata)
end
end
And my function definition in a separate file inside the @crm folder
function [Tout,Yout]=runTimeDependent(self,n_0,tdata,nedata,Tedata)
TSPAN = [tdata(1) tdata(end)];
[Tout,Yout]=ode15s(@odefun,TSPAN,n_0);
function dydt=odefun(t,y)
% … ode function here
end
end
If i build my object and run the method everything works but if i ask 2 outputs i get an error
c=crm();
% definemy parameters ( Y0, t, ne, Te)
c.runTimeDependent(Y0,t,ne,Te); % This line works
[Tout, Yout] = c.runTimeDependent(Y0,t,ne,Te); %this line throws an error
Only when i ask both my outputs do i get an error
Error using indexing
Too many output arguments.
Error in test_timedep (line 4)
[Tout, Yout] = c.runTimeDependent(Y0,t,ne,Te); oop, output MATLAB Answers — New Questions