MATLAB: Converting a Fahrenheit degree to a Celsius degree, then use this function in a “for” loop to calculate the equivalent Celsius degrees for the Fahrenheit degrees from 0 to 200

@2hg

for loop

Best Answer

You don't need to use a for loop. See the following vectorized solution:
% create an array from 0 to 200 (default increment of one used)
deg_F = 0:200; %temperature in Fahrenheit
% convert Fahrenheit to Celsius
deg_C = (deg_F - 32) / 9 * 5; %temperature in Celsius