Al momento, stai seguendo questa domanda
- Vedrai gli aggiornamenti nel tuofeed del contenuto seguito.
- Potresti ricevere delle e-mail a seconda delle tuepreferenze per le comunicazioni.
Create a 4D array from 3D array with 3 columns, and 1D (row only) array with 3 columns
4 Commenti
Risposta accettata
24 Commenti
- 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.
Più risposte (2)
1 Commento
2 Commenti
Vedere anche
Categorie
Tag
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!Si è verificato un errore
Impossibile completare l'azione a causa delle modifiche apportate alla pagina. Ricarica la pagina per vedere lo stato aggiornato.
Seleziona un sito web
Seleziona un sito web per visualizzare contenuto tradotto dove disponibile e vedere eventi e offerte locali. In base alla tua area geografica, ti consigliamo di selezionare: .
Puoi anche selezionare un sito web dal seguente elenco:
Come ottenere le migliori prestazioni del sito
Per ottenere le migliori prestazioni del sito, seleziona il sito cinese (in cinese o in inglese). I siti MathWorks per gli altri paesi non sono ottimizzati per essere visitati dalla tua area geografica.
Americhe
- América Latina (Español)
- Canada (English)
- United States (English)
Europa
- 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)
Asia-Pacifico
- Australia (English)
- India (English)
- New Zealand (English)
- 中国
- 日本Japanese (日本語)
- 한국Korean (한국어)