Help needed; I am missing smth obvious on private functions
Afficher commentaires plus anciens
Below is a function (test) that I created in a directory I have named 'area1'; please note that I am using function test below to call function random0 which also resides in directory 'area1'. However, when I try to make function random0 private by creating a sub-directory named 'private' and placing the random0 function within 'private', I get an error telling me that random0 is undefined. I create the sub-directory 'private' using mkdir('area1','private') and then I drag the fx file containing random0 within 'private.' Any ideas on what it is that I am missing?
function ran1 = test(n,m,a,b) %RANDOM0 Generate uniform random numbers in [low,high) %Function test generates an array of uniform random numbers in the range %[low,high). Function random0 is private and as such resides in the private %folder.
if nargin < 2 m=n; end
ran1=(a+(b-a)*random0(n,m));
Réponse acceptée
Plus de réponses (0)
Catégories
En savoir plus sur Search Path dans Centre d'aide et File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!