If you access the data mostly by row, then an array of N structs (one struct per row) with 4 fields (one field per column) would be the most effective in terms of performance In your case, you might have 2 approaches, depending on how you need to access the data: These three types may be combined, in the sense that cell arrays and structs may have matrices and cell arrays and structs as elements (because thy're heterogeneous containers). Not sure about tables, I don't think is offered by the language itself might be an UDT that I don't know of. Same argument for structs, only the indexing is by name, not by number. | a function requires the data as such.| you need only indexing the data numerically (no algebraic operations).| there's a lot of data and has dynamic size.the tabular data has heterogeneous type (mixed element types, "jagged" arrays etc.).& you care about the speed of accessing data, or you need matrix operations performed on data, or some function requires the data organized as such.& either the amount of data is small, or is big and has static (predefined) size.the tabular data has a uniform type (all are floating points like double, or integers like int32).
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |