function [ M, d ] = imagic ( n ) % This totally useless function computes a magic matrix of the size % requested and adds the identity matrix. It then returns the inverse % and the determinant of the computed matrix. % % Ver. 0.01 Copyright (c) 2001 by The Mad Hatter % Mth 355 Fall 2001 % All the lines above, but not this one, will be returned in response % to the command help imagic % The disp() commands below illustrate how to add text to the % output of the command. You shouldn't overdo this! disp('imagic.m version 0.01 Copyright (c) 2001 by The Mad Hatter') disp('Guaranteed to be totally useless.') A = magic(n) + eye(n); M = inv( A ); d = det( A ); % Note the semicolon suppresses output from the statement. % Note the call [C,a] = imagic(4) assigns the computed matrix % to C and the computed determinant to a. % The call C = imagic(4) will assign the computed matrix to % C and will discard the computed determinant. % The call imagic(4) will assign the computed matrix to ans % and will discard the computed determinant.