clear allclccd('C:\Users\akess\Box Sync\PhD\PCCS\PCCS 190822\HRP with salt 190822\Textfiler')S = dir('*.txt');N = {S.name};for j=1:length(N)x = ones(2,length(N));Name=N(j);fid = fopen(Name); %THIS DOESNT WORK, DO YOU KNOW HOW TO FIX IT?
data = textscan(fid,'%s%s%s');A=data{1, 2}{132, 1};%mean count rate ch.1
B=data{1, 2}{134, 1};%mean count rate ch.2
A1=str2num(A);B1=str2num(B); x(1,j) = A1; x(2,j) = B1;end
I have several files I want to read and only take out certain values. I would like the loop to open one file at a time but fopen does not seem to work with taking out one string from N. Can anyone help me?
Best Answer