Array programming

Create a larger array by expanding each element of an array into a subarray. in matlab

The following Matlab project contains the source code and Matlab examples used for create a larger array by expanding each element of an array into a subarray. . REPLICATE is a companion to REPMAT, but instead of tiling a larger array with the input array, REPLICATE does the equivalent of calling REPMAT on each individual element and then tile the results together.

Count members. in matlab

The following Matlab project contains the source code and Matlab examples used for count members. . C = COUNTMEMBER(A,B) counts the number of times the elements of array A are present in array B, so that C(k) equals the number of occurences of A(k) in B.

Reshape 1d to 2d with balance in matlab

The following Matlab project contains the source code and Matlab examples used for reshape 1d to 2d with balance. reshape1dto2dbalance.m ---------------------- If possible then reshapes 1D array (vector) 'A' into 2D array 'B' such that: abs(NC-NR) is minimized where NR=number of rows in B NC=number of columns B Note: Elements of A are placed column-wise in B. reshape1dto2dbalanceTest.m -------------------------- A simple test program

Union of several arrays in matlab

The following Matlab project contains the source code and Matlab examples used for union of several arrays. function [varargout] = union_several (varargin) % function [varargout] = union_several (varargin) % varargout{1} is the union vector % varargout{i>1} are the indices of the various varargin (in their order) numarr = length(varargin); union_arr = varargin{1}; for i=1:numarr         union_arr= union(union_arr,varargin{i}); end varargout{1} = union_arr; for i=1:numarr         [union_arr, temp,varargout{i+1}]= union(union_arr,varargin{i}); end         

Intersect several arrays in matlab

The following Matlab project contains the source code and Matlab examples used for intersect several arrays. function [varargout] = intersect_several (varargin) % function [varargout] = intersect_several (varargin) % varargout{1} is the intersect vector % varargout{i>1} are the indices of the various varargin (in their order) numarr = length(varargin); intersect_arr = varargin{1}; for i=1:numarr         intersect_arr= intersect(intersect_arr,varargin{i}); end varargout{1} = intersect_arr; for i=1:numarr

Extends the matlab command trisurf() to put a contour plot below the mesh.

The following Matlab project contains the source code and Matlab examples used for extends the matlab command trisurf() to put a contour plot below the mesh. . [cout,hout] = trisurfc(xin,yin,zin,N) Regularly just called by with the following syntax to produce a plot: trisurfc(xin,yin,zin,N) Where xin,yin,zin are 1-D arrays of the x,y,z triples of the points in your mesh.

Reshape2matrix v1.0 (oct 2009) in matlab

The following Matlab project contains the source code and Matlab examples used for reshape2matrix v1.0 (oct 2009). SYNTAX: a) N-dim array X to matrix Y: >> Y = reshape2matrix(X,DIM); b) Matrix Y to N-dim array X: >> X = reshape2matrix(Y,DIM,SIZE); DESCRIPTION: Some MATLAB or users defined functions do not work through an specific dimension in a multidimensional array, whether because its not supported like in FILTFILT or the output is a matrix like in CORRCOEF.

Pages

Subscribe to RSS - Array programming