Undefined Function Error for 'title.m' - What's Going On?

  • Context: MATLAB 
  • Thread starter Thread starter buildingblocs
  • Start date Start date
  • Tags Tags
    Error Function
Join the discussion
Ask a follow-up here, or get your own question answered by working scientists, mathematicians and engineers — people, not an autocomplete.
Real named experts · corrections over time · the nuance an AI answer skips
2 replies · 2K views
buildingblocs
Messages
17
Reaction score
1
I am occasionally coming across this message for a given m-file 'title.m':


Undefined function or method 'title' for input arguments of type 'char'.


Even for very basic scripts this happens. An explanation of what exactly is going on would be much appreciated
 
Physics news on Phys.org
Can you post the m-file? (You can use
Code:
tags.)
 
Code:
%Condition blocks example.
reserve = 100; %initial amount in the reservoir
allreserve = []; 
alloutflow = [];
for i = 1:20; %perform the following statements 20 times
    if reserve < 30
        lossrate = 0.3;
    else
        lossrate = 0.2;
    end %if reserve...
    outflow = lossrate * reserve; %calculate the amount of the snow that melts
    reserve = reserve - outflow; % subtract this amount from the reserve
    disp(['after day' num2str(i) ' outflow= ' num2str(outflow)...
        'reserve=' num2str(reserve)]);
    allreserve = [allreserve reserve];
    alloutflow = [alloutflow outflow];
end %for i ...
hold off
plot (allreserve, 'g-')
hold on
plot (alloutflow, 'r-')