Info

This question is closed. Reopen it to edit or answer.

how to delete 1st row of a matrix....help

1 view (last 30 days)
SANKAR JYOTI NATH
SANKAR JYOTI NATH on 16 Nov 2016
Closed: MATLAB Answer Bot on 20 Aug 2021
my txt file is
5-Mar-20150000
2.32611e+006 90 7.07107
2.32611e+006 99 7.61577
2.32611e+006 108 7.81025
2.32611e+006 141 7.07107
2.32611e+006 150 7.61577
2.32611e+006 159 7.81025
2.32611e+006 192 7.07107
2.32611e+006 201 7.61577
2.32611e+006 210 7.81025
2.32611e+006 243 7.07107
2.32611e+006 252 7.61577
2.32611e+006 261 7.81025
2.32611e+006 294 7.07107
2.32611e+006 303 7.61577
2.32611e+006 312 7.81025
2.32611e+006 321 7.21110
2.32611e+006 354 7.61577
2.32611e+006 363 7.81025
2.32611e+006 372 7.21110
2.32611e+006 405 7.28011
2.32611e+006 414 7.81025
2.32611e+006 423 7.21110
2.32611e+006 447 7.00000
2.32611e+006 456 7.28011
2.32611e+006 465 7.21110
2.32611e+006 474 7.21110
2.32611e+006 498 7.00000
i want to delete the date of the file which is in the 1st row......i have more than 300 files as this pattern
i am trying with this code:
yourFolder ='C:\Users\Parag\Desktop\open\march15\05-03-15';
ListOfFilenames = {};
dirListing = dir([yourFolder '/*.txt*']);
for Index = 1:length(dirListing)
baseFileName = dirListing(Index).name;
ListOfFilenames = [ListOfFilenames baseFileName]; end
set(handles.Display,'string',ListOfFilenames);
Selected = get(handles.Display, 'Value');
ListOfFileNames = get(handles.Display, 'string');
baseFileName = strcat(cell2mat(ListOfFileNames(Selected)));
fof2=fullfile(yourFolder, baseFileName);
data=importdata(fof2)
data1 = data(1,:)
data1 =[]

Answers (1)

KSSV
KSSV on 16 Nov 2016
Edited: KSSV on 16 Nov 2016
dinfo = dir('*.txt'); % get all text files
nfiles = length(dinfo) ; % totla number of text files
for K = 1:nfiles
filename = dinfo(K).name; %just the name
data = importdata(filename); %load just this file
%%do wjhat you want %%
num_data = k.data ; % picks only numbers data.
end

Community Treasure Hunt

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

Start Hunting!