title: use profile property of matlab in function
body: <p>let us consider following code</p>
  
  <pre><code>function  [y,m]=fibonacci(n);
  % return nth fibonnaci number
  profile on
  y=zeros(1,n);
  y(1)=0;
  y(2)=1;
   for k=3:n
       y(k)=y(k-1)+y(k-2);
   end
   m=y(n);
   profile viewer
  p = profile('info');
  profsave(p,'profile_results')
  end
  </code></pre>
  
  <p>of course  i can use tic and toc  function in matlab to calculate how  much time will taken by this function, but i want for self learning ,  customize with profile tools in matlab, for instance let us consider following little code</p>
  
  <pre><code>profile on
  plot(magic(35))
  profile viewer
  p = profile('info');
  profsave(p,'profile_results')
  </code></pre>
  
  <p>result is given
  <a href="https://i.stack.imgur.com/3lqci.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/3lqci.png" alt="enter image description here"></a></p>
  
  <p>i want to  use same property in function, but is says that now built in function is used here, so can i use profile properties in function?</p>