0

I need to analyze a big source code.Code contains several function calls. Depending upon the computation and communication between function calls, i will need to figure out the best configuration scheme for the overall execution of the source code.

According to me ,

Data communicated in calling a function(if it is on different machine,server etc)=Input Data Size+Output Data Size

for getting the input data size and output data size ,i think i should rewrite all functions to have variable number of inputs and variables outputs.

[varargout] samplefunction(varargin) {

FOR i=0:nargin
 inputdata=inputdata+sizeof(varargin(i));



% Do stuff here


}

isn't there a way to calculate size of cell array(varargin/varargout) directly in Matlab ?

or if u can suggest another approach to measure communicated data between function call ?

4

1 回答 1

0

cellfun()使用字符串输入调用会非常快:

sizes = [cellfun('size',varargin,1); cellfun('size',varargin,2)];

或者

lenghts = cellfun('length',varargin);

或者

numels  = cellfun('prodofsize',varargin);
于 2013-06-12T08:16:54.897 回答