How many .txt files to compile matlab remove the first line using vertcat a big shift matrix?

1 view (last 30 days)
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,:)=[]; -----------
  1 Comment
Ooogiiii
Ooogiiii on 27 Mar 2015
Error using vertcat CAT arguments dimensions are not consistent.
Error in diplom_first (line 18) A = vertcat(A, newData1.data);

Sign in to comment.

Answers (0)

Categories

Find more on Characters and Strings in Help Center and File Exchange

Tags

Community Treasure Hunt

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

Start Hunting!