Scalar structure required for this assignment.
275 visualizaciones (últimos 30 días)
Mostrar comentarios más antiguos
Luca Re
el 2 de Jun. de 2023
Comentada: Matt J
el 5 de Jun. de 2023
Sis =
1×82 struct array with fields:
Name
dailyprof
cc
gapp
ttrange
Ntradess
>> class(D_(:,2))
ans =
'cell'
>> Sis.On=D_(:,2);
Scalar structure required for this assignment.
hi ..how do I add it as a field?
2 comentarios
James Tursa
el 2 de Jun. de 2023
Editada: James Tursa
el 2 de Jun. de 2023
What is the size of D_? Are you trying to add each cell element of D_(:,2) as a struct field in Sis?
Respuesta aceptada
Matt J
el 2 de Jun. de 2023
Editada: Matt J
el 2 de Jun. de 2023
Your intention with the code is not clear, but here is one possibility,
[Sis.On]=deal(D_{:,2});
4 comentarios
Matt J
el 5 de Jun. de 2023
You seem to have deleted your follow-up questions, but it's preferable anyway to put those in a new thread.
Más respuestas (2)
VBBV
el 2 de Jun. de 2023
Sis.On={D_(:,2)};
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!