By default, MATLAB’s plot function draws no markers in the figure that it produces. One may explicitly specify a marker and a line style following the line specification string syntax; however, only one marker type and line style may be applied to a single data set.
Further we present a simple MATLAB function that implements the same functionality as R’s matplot function and allows to set style for each data line shown.
The MATLAB function
cross implements the vector product for two kinds of input data: a pair of vectors and a pair of N-D arrays. Surprisingly, it works slower for successive computations of cross products for 3-D vector pairs than the following naive implementation.
function C = cross3d(A, B)
C = [A(2)*B(3) - A(3)*B(2), ...
A(3)*B(1) - A(1)*B(3), ...
A(1)*B(2) - A(2)*B(1)];
Further, we estimate the median running time of
cross3d in a reproducible way using MATLAB scripts.
It is often convenient to obtain atomic masses for a given array of element names in a vectorized way. For example, one may use it to calculate the weighed RMSD (wRMSD) between two conformations of a protein specified by their atom coordinates and :
where and denotes the atomic mass of the ith atom.