hello everyone! Many .txt files in the folder.Matlab him into a big one, including how to help me transfer matrix format. Write the following code into the file with the last two columns = NaN cut short part is going wrong.
---------- % % %-----Raindrop(R,t) close all; clear all; clc; A=zeros(1,28); col1 = cell(1); col2 = cell(1); col1{1} = char(zeros(1,10)); col2{1} = char(zeros(1,10)); files = dir('C:\myfolder\*.txt'); for k=1:length(files) newData1 = importdata(files(k).name); vars = fieldnames(newData1); for i = 1:length(vars) assignin('base', vars{i}, newData1.(vars{i})); end textt = newData1.textdata; A = vertcat(A, newData1.data); col1 = vertcat(col1, textt{:,1}); col2 = vertcat(col2, textt{:,2}); end A(1,:)=[]; -----------