program accepting vector of hourly temperatures in matlab

You can accept a vector of hourly temperatures in MATLAB using input function combined with transpose function.

Here's the code snippet:

main.m
% Accept vector of hourly temperatures
hourly_temperatures = input('Enter hourly temperatures (separated by space): ');
hourly_temperatures = transpose(hourly_temperatures);
174 chars
4 lines

The input function prompts user to input a vector of hourly temperatures separated by space. The transpose function is then used to convert the row vector to a column vector for ease of processing.

Note: The user input values should be separated by spaces, not commas, to be compatible with input function.

gistlibby LogSnag