Hi everyone, hope you are all healthy.
I’m a mechanical engineering student and I come from MATLAB, so I am sorry for my heresies.
I currently am working on a NASTRAN .hdf5 output. There is a package to open such files, that stores informations in a vector with several fields (hope it is the correct word!) as shown in the following piece of code:
GRIDcard
111403-element Array{HDF5.HDF5Compound{7},1}:
HDF5.HDF5Compound{7}((567377, 0, [-76.9957, -13.1615, -82.5], 0, 0, 0, 1), ("ID", "CP", "X", "CD", "PS", "SEID", "DOMAIN_ID"), (Int64, Int64, HDF5.FixedArray{Float64,(3,)}, Int64, Int64, Int64, Int64))
HDF5.HDF5Compound{7}((567378, 0, [-74.1493, -12.1665, -82.5], 0, 0, 0, 1), ("ID", "CP", "X", "CD", "PS", "SEID", "DOMAIN_ID"), (Int64, Int64, HDF5.FixedArray{Float64,(3,)}, Int64, Int64, Int64, Int64))
I would like to save all X entries in a single matrix defined as:
GRID = [
X[1]'
X[2]'
...
X[n]'
]
Is it possible to do it without a for loop that reads all entries as:
GRID = zeros(n,3)
for i = 1:n
GRID[i,:] = GRIDcard[i].data[3]
end
Thank you all in advance, and I hope I haven’t broken too many rules!