Removing a particular column from multiple large datasets.

I am importing multiple large datasets to carry out analysis. One of the columns in each imported file is preventing me from analysis carrying out analysis.
I want to remove that column (In my case it's column 1) from all of the datasets. Multiple files are being imported at once using a test list.
for i = length(testlist.data)
DataIn1 = importdata([FolderINPUT1 '\' FilesList1(testlist.data(i,1)).name], '\t' );
end
I want to remove all of column 1 for every file which has been imported, can anyone help me with this?

Answers (1)

If A is your matrix....to remove first column.
A(:,1) = [] ;

8 Comments

I tried this already and I got, "matrix index is out of range for deletion."
That's if If I put it inside the for loop. When I use it outside the for loop i get an error further down that says " expected one output from a curly brace or doit indexing expression, but there were 0 results.
I know that the piece of code on the line where the error is coming from is correct, as it's working for another dataset(for some reason it doesn't have the problematic column). As a result I've concluded it must be due to an error in DataIn1
Attach one text file here or attach the data DataIn1. It seems you are not getting a matrix.
I can't send in the full file, I'll attach a screenshot.
The time column has been dealt with, I removed that further up, it's the next column in is causing me problems, In particular, when it changes from 0 to 0x7
data = importdata(myfile) ;
data = data.data ;
data(:,1) = [] ;
Thank you for your help. I am now getting an error saying that dot indexing cannot be used for this new variable further down in the code.
Can you tell ...how
data = importdata(myfile) ;
looks like?
Also read about readmatrix, textscan.
data = importdata(myfile); is shown above in the original question.

Sign in to comment.

Categories

Asked:

on 12 Oct 2020

Commented:

on 12 Oct 2020

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!