MATLAB Answers

I need to find the the lowest temperature recorded each year in a dataset. I am having a hard time while writing the loops.

3 views (last 30 days)
Audrey Boyd
Audrey Boyd on 18 Apr 2017
Answered: TS on 18 Apr 2017
The data set has 10 columns but I only want to look at the TMIN(Temperature minimum) and the year column.
if true
% code
clear; clc;
load Weather;
counter = 0; %I know I need this just don't know where
year = find(W.Year == 1974);
Y = W(year, :);
Year = (Y.Year);
temp = find(W.TMIN);
T = W(temp, :);
Temp = (T.TMIN);
min = Temp(1)
for k = Year >= 1974 & Year <= 2010;
for t = 1:length(temp)
if min > Temp(t)
min = Temp(t)

Answers (1)

TS on 18 Apr 2017
I recommend using min
find smallest value of random 5x5 matrix:

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!