calling a built-in private function
Mostrar comentarios más antiguos
I'm using stream2 for a big problem that takes about a week to run on a high-performance computer. The profiler tells me that more than half of the processing time is just overhead in the stream2 function. Just a few simple tweaks to the stream2 function could save me days of processing time, but stream2 calls stream3c, which is in a private folder. How do I tell my new stream2_fast function to call stream3c?
My new function looks something like this:
function xy = stream2_fast(...)
% My attempt to addpath, of course, is in vain:
addpath('/Applications/MATLAB_R2022a.app/toolbox/matlab/specgraph/private')
xy = cell(1,N);
parfor k = 1:N
xy{k} = stream3c([],[],[],vx,vy,[],xind(k),yind(k),[],step,maxvert)';
end
end
The addpath line above doesn't add the path to the private folder, so when I run stream2_fast I get this error message:
'stream3c' is not found in the current folder or on the MATLAB path, but exists in:
/Applications/MATLAB_R2022a.app/toolbox/matlab/specgraph/private
If I change directory to the private folder, the code works perfectly and is much faster than MATLAB's stream2. But is there a way to call stream3c without changing directory to the private folder?
Respuesta aceptada
Más respuestas (0)
Categorías
Más información sobre Startup and Shutdown en Centro de ayuda y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!