Skip to main content
added 7 characters in body
Source Link

everyone! I'm new in Mathematica and I'm struggling quite a lot. Right now, I'm trying to perform some calculations out of a bunch of lists I already have listed from 1 to 131 and that have a format as follows:

list1={String"String", Stringnumber, number{x1,y1}, number{x2,y2} {number,..., number}}
list2={String"String", Stringnumber, number{x1,y1}, number{x2,y2}, {number,..., number}}

And so on... Basically, I want to do some calculations with specific elements of my list, create a new list each time and export it.

By now, I have this function:

F[list_]F[list1_] := Do[esc = list[[2]];
dist = Norm[list[[4]] - list[[3]]];
real = {list[[1]]};
AppendTo[real, list[[5]]*esc/dist]; Return[real]]

But like this I have to type F[tc1] and so on until F[131] and keep exporting each time. If you have any ideas, I would be really grateful.

everyone! I'm new in Mathematica and I'm struggling quite a lot. Right now, I'm trying to perform some calculations out of a bunch of lists I already have listed from 1 to 131 and that have a format as follows:

list1={String, String, number, number, {number,..., number}}
list2={String, String, number, number, {number,..., number}}

And so on... Basically, I want to do some calculations with specific elements of my list, create a new list each time and export it.

By now, I have this function:

F[list_] := Do[esc = list[[2]];
dist = Norm[list[[4]] - list[[3]]];
real = {list[[1]]};
AppendTo[real, list[[5]]*esc/dist]; Return[real]]

But like this I have to type F[tc1] and so on until F[131] and keep exporting each time. If you have any ideas, I would be really grateful.

everyone! I'm new in Mathematica and I'm struggling quite a lot. Right now, I'm trying to perform some calculations out of a bunch of lists I already have listed from 1 to 131 and that have a format as follows:

list1={"String", number, {x1,y1}, {x2,y2} {number,..., number}}
list2={"String", number, {x1,y1}, {x2,y2}, {number,..., number}}

And so on... Basically, I want to do some calculations with specific elements of my list, create a new list each time and export it.

By now, I have this function:

F[list1_] := Do[esc = list[[2]];
dist = Norm[list[[4]] - list[[3]]];
real = {list[[1]]};
AppendTo[real, list[[5]]*esc/dist]; Return[real]]

But like this I have to type F[tc1] and so on until F[131] and keep exporting each time. If you have any ideas, I would be really grateful.

Source Link

How can I perform calculations out of several lists, create new ones with the results and export each one of them?

everyone! I'm new in Mathematica and I'm struggling quite a lot. Right now, I'm trying to perform some calculations out of a bunch of lists I already have listed from 1 to 131 and that have a format as follows:

list1={String, String, number, number, {number,..., number}}
list2={String, String, number, number, {number,..., number}}

And so on... Basically, I want to do some calculations with specific elements of my list, create a new list each time and export it.

By now, I have this function:

F[list_] := Do[esc = list[[2]];
dist = Norm[list[[4]] - list[[3]]];
real = {list[[1]]};
AppendTo[real, list[[5]]*esc/dist]; Return[real]]

But like this I have to type F[tc1] and so on until F[131] and keep exporting each time. If you have any ideas, I would be really grateful.