Asked by desert_scientist90
on 22 Oct 2019

Hi I have a data set on a 0.5 grid, the dimension for x is 141, y is 71 and t is 38. I am trying to calculate the z score which I already did. I am trying to plot the the Z scores on a time series but since is greater than two dimensions is not possible to do it. Is there anyway to work around this without ruining the yearly data? Thanks in advance for your help

Answer by Cris LaPierre
on 23 Oct 2019

The uploaded file contains a single variable with size 1x71x38. If that is correct, just use the squeeze function to remove the singleton dimension.

Z = squeeze(Z);

The new size of Z is 71x38.

From here you can create a line plot for each column

plot(Z)

or a 3D surface

surf(Z)

Cris LaPierre
on 23 Oct 2019

I'm not sure that's the way you want to visualize this data. Viewing that way makes it hard to see any patterns. Having each year be it's own line makes it easier to observe a yearly pattern related to the value of y.

plot(Z)

When plotting so X is year, it is connecting data points across years, masking any yearly trend (line 1 = first data point from each year, line 2 = second data point from each year, etc).

plot(t,Z')

desert_scientist90
on 23 Oct 2019

Cris LaPierre
on 23 Oct 2019

I'm pretty sure this plot was created using the code

plot(Z(:))

Here, the values of X represent the index of the data point. The command Z(:) turns the entire array into a one-column vector. You can see that syntax described in this doc page. What that means is all the columns were placed head-to-tail. There are 71*38 data points, or 2698.

Sign in to comment.

Answer by desert_scientist90
on 23 Oct 2019

Cris LaPierre
on 23 Oct 2019

Cris LaPierre
on 23 Oct 2019

Sign in to comment.

Opportunities for recent engineering grads.

Apply Today
## 2 Comments

## darova (view profile)

## Direct link to this comment

https://ch.mathworks.com/matlabcentral/answers/486683-question-regarding-data-grid#comment_758984

## desert_scientist90 (view profile)

## Direct link to this comment

https://ch.mathworks.com/matlabcentral/answers/486683-question-regarding-data-grid#comment_759110

Sign in to comment.