% ---------------------------------------------------------------------- % Generate a temperature conversion table, followed by a graph % Instructor: Nam Sun Wang % ---------------------------------------------------------------------- clear all % Start fresh C = [0:100]'; % Generate a column vector of x from 0 to 100 F = 32 + 1.8 * C; % Convert from Celsius to Ferenheit [C F] % Display in tabular format pause % Pause for non-Window operating environment (e.g., DOS) plot(C,F) % Display in graphical format; C in x-axis; F in y-axis save 'temp1.dat' C F -ascii % Save data in a file; C before F in 1-column format combine=[C F]; save 'temp2.dat' combine -ascii % Save data in a file in 2-column format