% data is a matrix. density = data(:, 1) ./ (data(:, 2) .* data(:, 3) * data(:, 4));
% data is a table or struct of arrays. density = data.mass ./ (data.height .* data.width .* data.length); % Alternatively, with individual vectors. density = mass ./ (theHeight .* theWidth .* theLength);