You can convert a cell array of name-value pairs to a structure using the struct
function.
Assuming you have a cell array myCell
with name-value pairs where each name is a string and each value is a scalar:
main.m47 chars2 lines
You can convert it to a structure using:
main.m30 chars2 lines
This will create a structure with fields corresponding to the names and values corresponding to the values in the original cell array:
main.m51 chars5 lines
gistlibby LogSnag