How to divide two datasets element wise ?

6 visualizaciones (últimos 30 días)
Victoria Pake
Victoria Pake el 6 de En. de 2021
Comentada: Victoria Pake el 6 de En. de 2021
Dear all,
I have two datasets, each of the form 2464x2464x14, where the 14 represents the year. In other words I have the same matrix stacked on each other for 14 different years. One dataset represents current prices and the other previous year prices. I want them to divide each other elementwise such that i end up with one matrix 2464x2464x14, which is adjusted by inflation. I am not sure what is the best way to do it?
I did it for one element : data_adjusted = (data_CP(1,1,1)./data_PYP(1,1,1))*1000;
How can i tell matlab to do it row for row and then switch to the matrix of the next year?
thanks in advance :)

Respuesta aceptada

KSSV
KSSV el 6 de En. de 2021
iwant = data_CP./data_PYP*1000 ;
  1 comentario
Victoria Pake
Victoria Pake el 6 de En. de 2021
Thanks, did not expect it to be so simple. it worked :D

Iniciar sesión para comentar.

Más respuestas (0)

Categorías

Más información sobre Creating and Concatenating Matrices en Help Center y File Exchange.

Etiquetas

Community Treasure Hunt

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

Start Hunting!

Translated by