Mathematica 9 is now available
Student Support Forum
-----
Student Support Forum: 'Manipulating array elements in FOR and DO loops' topicStudent Support Forum > General > "Manipulating array elements in FOR and DO loops"

Next Comment >Help | Reply To Topic
Author Comment/Response
Buz Barstow
06/20/00 2:04pm

I'm trying to write a program in Mathematica to import some data files. Here's the problematic bit,

This command gets a list of files in the working directory,

files = FileNames[''output*.dat'']

This works out how many files my C program has produced

l = Length[files]

The bit I'm having the problem with is here. The program plots fine, but, at the top of each output file are two headers that tell Mathematica how to label the axes on the plots. I want to delete these from the imported lists before I pass them to ListPlot, but Mathematica won't let me do delete operations in any programming statement, like DO or FOR.

For[i = 1, i <= l, i++, z = Import[ files[[i]]]; lab = z[[1]]; Delete[z, 1];
ListPlot[z, AxesLabel -> lab]]

Is it just a problem with my code, or does Mathematica have some sort of protection mechanism?

Thanks in advance,

Buz

URL: ,

Subject (listing for 'Manipulating array elements in FOR and DO loops')
Author Date Posted
Manipulating array elements in FOR and DO loops Buz Barstow 06/20/00 2:04pm
Re: Manipulating array elements in FOR and DO l... Aaron Honecker 06/22/00 10:02am
Re: Manipulating array elements in FOR and DO l... Fabrice P. L... 06/22/00 10:11am
Next Comment >Help | Reply To Topic