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
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
 
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-')
 

Similar threads

  • · Replies 4 ·
Replies
4
Views
3K
  • · Replies 11 ·
Replies
11
Views
3K
  • · Replies 1 ·
Replies
1
Views
9K
Replies
3
Views
5K
  • · Replies 5 ·
Replies
5
Views
9K
Replies
4
Views
17K
  • · Replies 3 ·
Replies
3
Views
2K
Replies
1
Views
18K
  • · Replies 1 ·
Replies
1
Views
3K
  • · Replies 6 ·
Replies
6
Views
3K