how to generate structure member values with only one index data of parent structure .
1 visualización (últimos 30 días)
Mostrar comentarios más antiguos
Vamsi
el 27 de Jul. de 2023
Comentada: Stephen23
el 28 de Jul. de 2023
how to generate structure member values with only one index data of parent structure .
struct.member.values(1500,1) from this structure need only struct.member.values(200,1)
2 comentarios
Respuesta aceptada
Stephen23
el 27 de Jul. de 2023
In lieu of your actually answering my questions here I will presume that both badly-named STRUCT and MEMBER are scalar structures, and that given your comment here MEMBER has multiple fields from which you want to extract one value from element (200,1).
S.member = cell2struct(num2cell(rand(1500,1,10),1:2),"val"+(1:10),3) % fake data
S.member
You can extract element (200,1) from each field of MEMBER as follows:
V = structfun(@(a)a(200,1),S.member)
4 comentarios
Stephen23
el 28 de Jul. de 2023
"couldn't able upload any data , due to some reasons "
You do not need to upload your private data, just some random values that are stored in exactly the same way.
Más respuestas (0)
Ver también
Categorías
Más información sobre Structures en Help Center y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!