Hi,
I have my results in the format given below, i need to restructure the out put in the format mentioned in the desired output section.
Input: {{2.34978,{a->20.256,b->-8.1895110^-16}},{2.34978,{a->20.256,b->-8.1895110^-16}}}
Out put should create two separate sets for Values of a and b, which i need to pass to next function
Desired Output: {{a{20.256,20.256}},{b{-8.1895110^-16,-8.1895110^-16}}
PS: If i try to use string operations, exponential values disappear in the set. there must be a way to use list operation to restructure the output.
My input is like this,
{2.99427,{[Theta]->20.256,[Beta]->-7.28473*10^-16}}
Currently i am using String operations to achieve this set
usableValueSet = pdist[[2]];
thetaValueString = usableValueSet[[1]];
betaValueString = usableValueSet[[2]];
thetaValueSet = StringSplit[TextString[thetaValueString], “->”];
thetaValueNumeric = thetaValueSet[[2]];
betaValueSet = StringSplit[TextString[betaValueString], “->”];
betaValueNumeric = betaValueSet[[2]];
AppendTo[thetaList, thetaValueNumeric];
AppendTo[betaList, betaValueNumeric];
and the output i get is like this
{ThetaValues { 20.256, 20.256, 20.256, 20.256, 20.256},BetaValues { -0.000000000000000844162, -0.000000000000000755682, -0.000000000000000809403, -0.000000000000000850243, -0.000000000000000775544}}
Something like this?
matrix = Transpose[{a, b} /.
Map[Last, {{2.34978, {a -> 20.256,
b -> -8.1895110^-16}}, {2.34978, {a -> 20.256,
b -> -8.1895110^-16}}}]];
StringJoin["{{a", ToString[matrix[[1]]], "},{b",
ToString[FortranForm /@ matrix[[2]]]]
yeah Exactly this, it has simplified the formatting for me alot. Thank you so much, Blessings