Vous suivez désormais cette question
- Les mises à jour seront visibles dans votre flux de contenu suivi.
- Selon vos préférences en matière de communication il est possible que vous receviez des e-mails.
Create a 4D array from 3D array with 3 columns, and 1D (row only) array with 3 columns
4 commentaires
Réponse acceptée
24 commentaires
- First off, I appreciate your follow-up. Thank you.
- Second, I could have done a better job explaining, and also naming the variables. Let me try to explain what I know or what I think I know.
- I have a test data file (.mat file) that contains simulated data, received from somewhere. I don't know what went into its making, or how it was created. When I load that file into Matlab, I can see that the variable name is 'xyz' and its size is 3x241x161x161, a 4D variable as we have been discussing.
- I also have another test data file, that has simulated magentic field data. Exact similar structure (3x241x161x161), only the variable name is different ('field'). Below, let me explain about 'xyz'.
- A note that came along with the test data file says that the first dimention of the 'xyz' variable has values for x, y, z coordinates, this I could also confirm as shown in the image snippet I posted earlier. The 2nd, 3rd and the 4th dimension of 'xyz' are the dimension of a region of space where cubic grids are created.
- My understanding is that first, the program constructs a region of space of 241x161x161 grid-units.Then the program creates grids (cubes). The note also mentions that a fixed grid-size of 0.25 has been used, so, for example, for the test data, there will be 241/0.25 = 964 cubic grids, 161/0.25 = 644 cubic grids and again 644 cubic grids along the x, y and z direction.
- Now that was with the simulated data.
- Next, I want to use my own data, real data (in the sense of "not-simulated"). I have two sets of data, (i) a 3D array of size 576x3x4 for x,y,z coordinate values, and (ii) another same size 3D array for magnetic field (Bx, By, Bz) values. For my own data, I wanted to create a region of space that is 100x100x100 grid units, and say, I will use the same grid size of 0.25. So you see, the total grid space dimension is not fixed. For simulated data, it happend to be 241x161x161, for my own data, I wanted to use 100x100x100. Actually, the total grid dimension will be calculated by the min and max values in each (x, y, z) column, but it complicates the explanation, so for now, I wanted to use 100x100x100.
- I will use a different name for my variable from now on. I want to create, say a 'myXYZ' variable that has x,y,z coordinate values of size 576x3x4 in its 1st dimension, and 100, 100, 100 in its 2nd, 3rd and the 4th dimension.
- Once I know how to create 'myXYZ', I will create 'myFIELD' variable similarly.
Plus de réponses (2)
2 commentaires
Voir également
Catégories
Tags
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!Une erreur s'est produite
Impossible de terminer l’action en raison de modifications de la page. Rechargez la page pour voir sa mise à jour.
Sélectionner un site web
Choisissez un site web pour accéder au contenu traduit dans votre langue (lorsqu'il est disponible) et voir les événements et les offres locales. D’après votre position, nous vous recommandons de sélectionner la région suivante : .
Vous pouvez également sélectionner un site web dans la liste suivante :
Comment optimiser les performances du site
Pour optimiser les performances du site, sélectionnez la région Chine (en chinois ou en anglais). Les sites de MathWorks pour les autres pays ne sont pas optimisés pour les visites provenant de votre région.
Amériques
- América Latina (Español)
- Canada (English)
- United States (English)
Europe
- Belgium (English)
- Denmark (English)
- Deutschland (Deutsch)
- España (Español)
- Finland (English)
- France (Français)
- Ireland (English)
- Italia (Italiano)
- Luxembourg (English)
- Netherlands (English)
- Norway (English)
- Österreich (Deutsch)
- Portugal (English)
- Sweden (English)
- Switzerland
- United Kingdom(English)
Asie-Pacifique
- Australia (English)
- India (English)
- New Zealand (English)
- 中国
- 日本Japanese (日本語)
- 한국Korean (한국어)