# Need serious help with lists!

Posted 8 years ago
9618 Views
|
4 Replies
|
0 Total Likes
|
 Here is my code (pasted below). How do I append values to the end of my lists? Either append isn't working or the debugging lines I wrote to confirm the values were appended isn't working. What am I doing wrong?I don't honestly believe I have a future in this... it's not something I am smart enough to learn... an IQ of 150 just isn't high enough for Mathematica and physics I don't think.(* Create empty lists *) xlist={}; ylist={}; zlist={};(* Take inputs for ECEF *) (Label[startinput];x = Input["What is the x coordinate?"]; y = Input["What is the y coordinate?"]; z = Input["What is the z coordinate?"]; Append [xlist, x] Append [ylist, y] Append [zlist, z] (Label[errorcontrol]; again=InputString["Enter more coords? Y for yes, N for no"]; If [again=="Y", Print["Okay!"];Goto[startinput]]; If [again!="N", Print["Sorry, this is an invalid input here!"];Goto[errorcontrol]]; If [again=="N", Print["Okay."]]));(* Debugging *) Print[xlist] Print[ylist] Print[zlist] Print[x] Print[y] Print[z](* Put in Coordinate Form *) GeoPositionXYZ[{x, y, z}, "ITRF00"];(* Convert to LLA *) GeoPosition[%](* Display Map *) GeoGraphics[GeoMarker[GeoPosition[%]],GeoRange -> "World", GeoProjection -> "Robinson"](* Display 3D Plot *) ListPointPlot3D[{{x, y, z}}]
4 Replies
Sort By:
Posted 8 years ago
 I would also sprinkle some semicolons after the Print commands: (*Create empty lists*)xlist = {}; ylist = {}; zlist = {}; (*Take inputs for ECEF*)(Label[startinput]; x = Input["What is the x coordinate?"]; y = Input["What is the y coordinate?"]; z = Input["What is the z coordinate?"]; AppendTo[xlist, x] ; AppendTo[ylist, y]; AppendTo[zlist, z]; (Label[errorcontrol]; again = InputString["Enter more coords? Y for yes, N for no"]; If[again == "Y", Print["Okay!"]; Goto[startinput]]; If[again != "N", Print["Sorry, this is an invalid input here!"]; Goto[errorcontrol]]; If[again == "N", Print["Okay."]])); (*Debugging*) Print[xlist] Print[ylist]; Print[zlist]; Print[x]; Print[y] ; Print[z]; (*Put in Coordinate Form*)GeoPositionXYZ[{x, y, z}, "ITRF00"]; (*Convert to LLA*)GeoPosition[%] (*Display Map*)GeoGraphics[GeoMarker[GeoPosition[%]], GeoRange -> "World", GeoProjection -> "Robinson"] (*Display 3D Plot*)ListPointPlot3D[{{x, y, z}}] 
Posted 8 years ago
 I'll try that. I'm getting so frustrated. I made a promise to have this project done by the end of summer and I'm only 2% done. If I fail at a research gig, how can I ever expect to succeed as a physicist? I'm starting to think I'll never have the only future worth living for. I'm about ready to give up. My friends were right. I'll never amount to anything.
Posted 8 years ago
 Have you tried using AppendTo instead of Append?
Posted 8 years ago
 Fine! If nobody wants to help me, I am hereby offering \$500 for help!