home *** CD-ROM | disk | FTP | other *** search
/ Liren Large Software Subsidy 10 / 10.iso / l / l460 / 2.ddi / GENERAL.DI$ / SUBSCRIB.M < prev    next >
Encoding:
Text File  |  1993-03-07  |  3.0 KB  |  94 lines

  1. function subscribe
  2. %SUBSCRIBE Become a subscribing user of MATLAB.
  3. %    Execute SUBSCRIBE to become a subscribing user of
  4. %    MATLAB.  This command will prompt you for your name
  5. %    and address.  If you are on a Unix system, it will
  6. %    email your subscription to MathWorks.  If you are not,
  7. %    it will create a log file that you can print out and
  8. %    FAX or mail to MathWorks.
  9.  
  10. %    Copyright (c) 1984-93 by The MathWorks, Inc.
  11.  
  12. disp(' ')
  13. disp('Join the MATLAB community by becoming a Subscribing User and keep')
  14. disp('up-to-date on the latest MATLAB developments! Anybody who uses')
  15. disp('MATLAB can become a Subscribing User at no cost -- you do NOT')
  16. disp('have to be a registered user. Subscribing Users are entitled to:')
  17. disp(' ')
  18. disp('  - Receive a subscription to the MathWorks Newsletter by regular mail')
  19. disp('  - Receive an email subscription to the MATLAB News Digest')
  20. disp('  - Obtain technical support')
  21. disp(' ')
  22. com = computer;
  23. if com(1:2) == 'PC' | com(1:2) == 'MA'
  24.    yn = 'n';
  25. else
  26.    yn = input('Do you wish to subscribe via email (y/n) [y]? ','s');
  27. end
  28. if isempty(yn)
  29.    yn = 'y';
  30. end
  31. ynf = 'y';
  32. if lower(yn(1)) == 'n'
  33.    ynf = input('Do you wish to subscribe by fax or regular mail (y/n) [y]? ','s');
  34.    if isempty(ynf)
  35.       ynf = 'y';
  36.    end
  37. end
  38. if lower(yn(1)) == 'y' | lower(ynf(1)) == 'y'
  39.    fid = fopen('subscribe.log','w');
  40.    fprintf(fid,'%s\n','Please register me as a subscribing user!');
  41.    s = input('Please enter your name:  ','s');
  42.    fprintf(fid,'%s\n',s);
  43.    s = input('Your Organization:  ','s');
  44.    fprintf(fid,'%s\n',s);
  45.    s = input('Street Address:  ','s');
  46.    fprintf(fid,'%s\n',s);
  47.    while ~isempty(s)
  48.       if strcmp(deblank(fliplr(deblank(s))),'.')
  49.          break
  50.       end
  51.       s = input('More address:  ','s');
  52.       fprintf(fid,'%s\n',s);
  53.    end
  54.    s = input('E-mail address:  ','s');
  55.    fprintf(fid,'%s\n',s);
  56.    s = ['Computer:  ', com];
  57.    fprintf(fid,'%s\n',s);
  58.    if (strcmp(com(1:2),'PC') | strcmp(com(1:2),'MA'))
  59.       s = ['MATLAB Serial Number:  ',siteid];
  60.       fprintf(fid,'%s\n',s);
  61.    else
  62.       s = ['MATLAB Site ID:  ',siteid];
  63.       fprintf(fid,'%s\n',s);
  64.       s = ['MATLAB server hostid:  ',hostid];
  65.       fprintf(fid,'%s\n',s);
  66.    end
  67.    fclose(fid);
  68.    disp(' ')
  69.    disp('Here''s the message you''ve created.')
  70.    disp('--------------------------------------------')
  71.    type subscribe.log
  72.    disp('--------------------------------------------')
  73.    disp(' ')
  74.    if lower(yn(1)) == 'y'
  75.       s = input('Is the message okay to send now (y/n) [y]? ','s');
  76.    end
  77.    if isempty(s)
  78.       s = 'y';
  79.    end
  80.    if lower(s(1)) == 'y'
  81.       if isunix
  82.          eval('!mail -s Subscribe subscribe@mathworks.com < subscribe.log');
  83.        end
  84.    else
  85.       disp('Output saved in the file subscribe.log.  Please print and')
  86.       disp('send to MathWorks at:')
  87.       disp(' ')
  88.       disp('  FAX:   508-653-2997')
  89.       disp('  Mail:  The MathWorks, Inc., 24 Prime Park Way, Natick, MA 01760')
  90.       disp('  Email: subscribe@mathworks.com')
  91.       disp(' ')
  92.    end
  93. end
  94.