Using matfile objects as input parameters
1 view (last 30 days)
Show older comments
I was wondering if a matfile object can be used as an input parameter for any matlab function, like in the following example:
distances = matfile(output_file,'Writable',true);
distances.D = zeros(1,N*(N-1)/2);
%Compute distances and store them in distances.D
% Applying multidimensional scaling to the distances matrix
[Y,eigvals] = cmdscale(D);
Is that possible? What about operators like distances.D*distances.D? Or should I reimplement matlab functions and operators again if I am using this kind of objects?
0 Comments
Accepted Answer
per isakson
on 12 Jul 2013
Edited: per isakson
on 12 Jul 2013
Yes, it is ok to pass around matfile objects, matObj; make some simple experiments.
I don't think the documentation says anything about several different matObj, which refer to the same file at the same time.
2 Comments
per isakson
on 14 Jul 2013
Speculation: There should be "no difference" between
distances.D = zeros(1,N*(N-1)/2);
and
[ matObj.Y, eigvals ] = cmdscale(D);
Make an experiment to find out how smart matfile is with large variables.
More Answers (0)
See Also
Categories
Find more on Write Data to Channel in Help Center and File Exchange
Products
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!