how to Dynamic Field References in place of setfield and getfield ?
5 visualizaciones (últimos 30 días)
Mostrar comentarios más antiguos
Newman
el 21 de Jun. de 2015
Comentada: Walter Roberson
el 23 de Jun. de 2015
hi i want to convert this code below to dynamic field references:
for fld = fieldnames(oi)'
o = setfield(o,fld{1},getfield(oi,fld{1}));
end
because it is showing warning an i want to convert my matlab code to c code .how shud i do that?
0 comentarios
Respuesta aceptada
Walter Roberson
el 21 de Jun. de 2015
for fld = fieldnames(oi)'
o.(fld{1}) = oi.(fld{1});
end
3 comentarios
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!