Code covered by the BSD License  

Highlights from
Performance in object-oriented matlab code

image thumbnail

Performance in object-oriented matlab code

by

 

16 Apr 2013 (Updated )

A very simple example to demonstrate an observation of mine regarding the use of classes in matlab.

F(N)
% Written by Dimitrios Korkinof
% Imperial College London
% http://www.korkinof.com

function o = F(N)
    
    large_mat = zeros(N,N);
    
    %% Functions
    o.get = @get;
    o.modify_one = @modify_one;
    
    %% Function Implementations
    function o = get()
        o.N = N;
        o.large_mat = large_mat;
    end
    function modify_one(i,j)
        large_mat(i,j) = rand(1,1);
    end
    
end

Contact us