data extraction from a cell - indexing
Mostrar comentarios más antiguos
Hi
in the MATLAB programming course (https://matlabacademy.mathworks.com/R2024a/portal.html?course=mlpr#chapter=2&lesson=6§ion=1) it is explained how cell array indexing works:
"You can index into a cell array using standard MATLAB indexing with parentheses, (). this returns a portion of the orgiginal cell array, and is therefore itself a cell array.
You can access the contents of cells in a cell array by indexing with curly braces, {}, rather than parentheses, ()."
Does this mean that { } dereference a pointer whereas () gives a pointer?
Lisa
3 comentarios
"Does this mean that { } dereference a pointer whereas () gives a pointer?"
In an approximate way you could think of it like that.
But rather than thinking in terms of pointers it is much more useful to think in terms of arrays. Arrays are what MATLAB works with. Container arrays (e.g. cell arrays) can contain other arrays. That is all. Where and how those arrays are stored in memory and how many copies of them exist are not matters that generally need to be considered by MATLAB users in most circumstances:
Some users with a programming background struggle with MATLAB because they keep trying to understand everything in terms of concepts that apply to C/C++ or whatever language they happen to like.
Elisabeth
el 20 de Jun. de 2024
"MATLAB is based on C"
MATLAB is not "based on C". The foundational concepts of MATLAB evolved before C was first released in 1972:
If anything, the biggest influence on MATLAB is probably FORTRAN.
Do not confuse the MATLAB language with the MATLAB JIT engine (mostly written in some kind of C). Do not confuse what languages the MATLAB JIT engine is written in with what language the MATLAB language is based on. Mixing things up will not help you understand how to use MATLAB or Python or any other high-level language.
Respuesta aceptada
Más respuestas (0)
Categorías
Más información sobre Creating and Concatenating Matrices en Centro de ayuda y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!