% ====================================================================== % temperature.m -- Compute and plot a graph of Celsius versus Fahrenheit % for the range -50 through 100 degrees Celsius. % % Written By : Mark Austin March 1997 % ====================================================================== % Allocate arrays for Celsius and Fahrenheit temperatures. tempC = zeros(2,1); tempF = zeros(2,1); % Compute temperatures at graph end-points. tempC(1) = -50; tempF(1) = 9*tempC(1)/5 + 32; tempC(2) = 100; tempF(2) = 9*tempC(2)/5 + 32; % Plot and label the graph plot( tempC, tempF ); grid; xlabel('Temperature (Celsius)'); ylabel('Temperature (Fahrenheit)'); title('Fahrenheit versus Celsius Temperature Conversion');