You can accept a vector of hourly temperatures in MATLAB using input
function combined with transpose
function.
Here's the code snippet:
main.m174 chars4 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