No BSD License  

Highlights from
Efficient Approximative Multiplication of Square Matrices

from Efficient Approximative Multiplication of Square Matrices by Henrik Pagenkopf
Public math open-source project in Java & MATLAB.

A* B exactly.
%
% Copyright (C) May/June 2005 by Henrik Pagenkopf
%

function Z = correct_PR_column(A, B, S, cB) % computes the column with index cB of S =approx.= A* B exactly.
%
% - cond: A,B,S are all square matrices of the same size >= 1 (type-safety of the ojbects used within this project).
%
  sa = size(A);
  sb = size(B);
  sc = size(S);

  if sa(1) >= 1 && sa(1)== sa(2) && sb(1)== sb(2) && sc(1)== sc(2) && sa(1)== sb(1) && sb(1)== sc(1) % => sa(2)== sb(2)== sc(2)

    s = sa(1);
    C = S;

    for k = 1 : s % calculate the scalar product.

      C(k, cB)= A(k,:)* B(:,cB);

    end; % for


    Z = C; % <- result

  else % error

  end

% return.

Contact us at files@mathworks.com