필터 지우기
필터 지우기

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

조회 수: 1 (최근 30일)
The data set has 10 columns but I only want to look at the TMIN(Temperature minimum) and the year column.
if true
% code
end
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)
end
end
end

답변 (1개)

TS
TS 2017년 4월 18일
I recommend using min https://de.mathworks.com/help/matlab/ref/min.html
find smallest value of random 5x5 matrix:
a=rand(5);
a_min=min(a);

카테고리

Help CenterFile Exchange에서 Programming에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by