I'm trying to create a 3D plot in Matlab of a structure element, Bstruct.scen_1. In this structure, each row is a year, each column is a distance, and the cell value is a population size (so for example, row 3, column 7 would yield the number of adults in year 3 at 7 km.) I want the X-axis to be the number of columns in Bstruct.scen_1, the Y-axis to be the actual value in the cell at (X,Z), and the Z-axis to be the number of rows in Bstruct.scen_1.
Conceptually, what I'd like to accomplish is:
plot3(Bstruct.scen_1(1:num_cols), Bstruct.scen_1(cellvalue), Bstruct.scen_1(1:num_rows))
I'm struggling with the syntax of structures and would really appreciate help in plotting both the elements and the dimensions of this structure. (I mostly code in R with 'tidy' data.) Thank you!