Hi, i many text files named Data. I attached as exemple one file to schow the structure of it. I wrote a function to read the Data of these files.
function [All]=myfunction(numoffiles) for k=1:numoffiles fid=fopen(['Data_' num2str(k) '.txt']); if fid == -1, error('Cannot open file'), end XX{k,1}=textscan(fid,'%f %f %f'); fclose(fid) Amplitude{k,1}=XX{k,1}{1}; Resonance{k,1}=XX{k,1}{2}; Height{k,1}=XX{k,1}{3}; end All.Amplitude=vertcat( Amplitude{:}); All.Resonance=vertcat(Resonance{:}); All.Height=vertcat(Height{:}); end
when i run this function with matlab 2014, i does what it should. But with Matlab 2017 i get Pronblems. Could someone help to solve the matter. mybe there is an easier way to sove it.
Best Answer