Skip to content
Snippets Groups Projects
Commit e4a12ea2 authored by giuliaghirardini's avatar giuliaghirardini
Browse files

[benchmark][speed] Updated functions

parent a8c6d8e4
No related branches found
No related tags found
No related merge requests found
function assignmentTime = assignmentSpeed(len) function assignmentTime = assignmentSpeed(len)
% ms = Mission(true);
% cl = Motor(ms);
cl = Test(1,2,3,4, len, len); cl = Test(1,2,3,4, len, len);
st = struct(cl); % converting class to a struct. calling of a warning st = struct(cl); % converting class to a struct. calling of a warning
......
function eigen = eigenSpeed(dim) function eigenTime = eigenSpeed(len)
%========EIGENVALUES PROBLEM======== (MATRICES) %========EIGENVALUES PROBLEM======== (MATRICES)
A = randn(dim,dim); A = randn(len,len);
testClass.a = A; testStruct.a = A; testClass.a = A; testStruct.a = A;
tic tic
eigStruct = eig(testStruct.a); eigStruct = eig(testStruct.a);
eigen.struct = toc; eigenTime.struct = toc;
tic tic
eigClass = eig(testClass.a); eigClass = eig(testClass.a);
eigen.class = toc; eigenTime.class = toc;
end end
\ No newline at end of file
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment