write a script which will print a table on screen of the temperature in celsius and the corresponding temperature in fahrenheit from 0o c to 100o c in steps of 5o c in matlab

main.m
% Define variables
cel = 0:5:100; % degrees celsius
fah = (cel.*(9/5))+32; % degrees fahrenheit

% Create table
T = table(cel', fah', 'VariableNames',{'Celsius','Fahrenheit'});

% Print table
disp(T);
201 chars
10 lines

The code above defines a list of Celsius temperatures (0, 5, 10, ..., 100) and then calculates the corresponding Fahrenheit temperatures. It then creates a table with two columns ("Celsius" and "Fahrenheit") and prints it on the screen using the disp() function.

gistlibby LogSnag