title: How to plot a matlab function for different parameters using hold on command
body: <p>I have a matlab function that contain some constant parameter, I want to draw that function, on say same figure, using hold on (probably) while changing the value of that constant.
  This my code:</p>
  
  <pre><code>close all
  clear all
  clc
  m = 5;
  x = 1:1:10;
  y = m*x + 10;
  h1 = figure;
  plot(x,y)
  m = 10;
  figure(h1);
  hold on
  plot(x,y,': r')
  </code></pre>
  
  <p>When I tried using this code, I got two lines coincident on each others; and it looks matlab just used last value for the parameter <code>m</code> how can I make it use different values.
  I found some stuff <a href="https://stackoverflow.com/questions/16722010/matlab-plot-a-function-with-different-parameters-into">here</a>, but doesn't fulfill my needs.
  Any suggestions?</p>