title: Matlab pass variable from one callback to another
body: <p>I am new to matlab and I want to pass one variable to another : </p>
  
  <p>Here is callback 1 where I write variable with input : </p>
  
  <pre><code>function pushbutton2_Callback(hObject, eventdata, handles)
  
  c = {'Enter image size:'};
  title = 'Input';
  dims = [1 35];
  definput = {'500'};
  answer = inputdlg(c,title,dims,definput);
  disp(answer);
  b = str2double(answer); // I want to pass this b to other callback
  disp(b); 
  guidata(hObject, handles);
  </code></pre>
  
  <p>And here I got another callback where I want that variable <strong>b</strong> would be my <strong>c</strong> : </p>
  
  <pre><code>function pushbutton1_Callback(hObject, eventdata, handles)
  
   h = randi([0 70],c,c); //here I want that c would be my b from another callback
      dlmwrite('myFile.txt',h,'delimiter','\t');
  
  
      [file,path] = uigetfile('*.txt');
      fileID = fopen([path,file],'r');
      formatSpec = '%d %f';
      sizeA = [c c];
      A = fscanf(fileID,formatSpec,sizeA);
      fclose(fileID);
  
      disp(A);
      image(A);
      saveas(gcf,'kazkas.png')
      %uiputfile({'*.jpg*';'*.png'},'File Selection');
  guidata(hObject, handles);
  </code></pre>