Borrar filtros
Borrar filtros

Multiply number of days for each month to data column

1 visualización (últimos 30 días)
BN
BN el 13 de Feb. de 2020
Comentada: BN el 13 de Feb. de 2020
Hello, I have a 1 x 10 cell which includes 10 tables. In all tables I have the date column and precip column. Dates are in monthly format from 1989 to 2018. I want to multiply the number of each month to the corresponding precip value in the same row. I want also to consider leap years. Here is my try so far:
for i = 1:numel(test)
t = test{i};
t.precip = eomday(date)*precip
test{i} = t;
end
this code gives me an error:
Error using eomday (line 13)
Y must be an integer year number.
I don't know what to do. Any help is highly appreciated. I attached my file.
Thank you.
Best regards

Respuesta aceptada

Bhaskar R
Bhaskar R el 13 de Feb. de 2020
for i = 1:numel(test)
test{i}.precip = test{i}.precip.*eomday(year(test{i}.date),month(test{i}.date));
end

Más respuestas (0)

Categorías

Más información sobre Tables en Help Center y File Exchange.

Etiquetas

Productos


Versión

R2018b

Community Treasure Hunt

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

Start Hunting!

Translated by