Mathematica 9 is now available
Student Support Forum
Student Support Forum: 'Deleting parts of arrays' topicStudent Support Forum > General > Archives > "Deleting parts of arrays"

Help | Reply To Topic
Author Comment/Response
01/28/10 1:13pm

Hello --

I have a large array of data points generated from a PDE solver program (Comsol) that I would like to plot in Mathematica. I have exported the raw data from Comsol and imported it into Mathematica as an array. The array is quite large, and I would like to trim it down so I can plot it over a specific range using ListDensityPlot.

Each subunit of the array has 3 elements (x and y positions, and value). So, my array looks like:


What I would like to do is do conditional operations on the array, and delete subunits (the entire x,y,value group) depending on whether x lies within a certain range, and whether y lies within a certain range.

For example, my y range goes from -800 to 1200, and I would only like to plot from -200 to 200, and similar in the x direction. Since the data file I have is so large, I need to parse down the data first in order to plot it (my computer keeps bogging down with the plotting of the entire array, I don't have enough memory).

Does anyone know how to do this? I would appreciate the help. I know I can use Delete to delete a certain subunit, but I don't know how to do conditional checks on each subunit. For instance, if I want to delete the 1st subunit, I type in:


But I am confused on how I would insert conditional statements for the Delete command.

Thanks in advance.

Carl --

URL: ,
Help | Reply To Topic