How to concatenate horizontaly and not vertically

3 views (last 30 days)
Hello everybody,
I'm sorry for my stupid question but I'm starting on matlab ..
I have a problem in my code ... my C and V vectors concatenate vertically ... how can I modify that?
clear all
clc
experience = 'Assets';
extension ='csv';
filelist = dir([experience,'/*',extension]);
nfiles = length(filelist);
% Pour chaque fichier, on récupère les infos et les données
% les données sont stockées dans des tableaux RAIES et DATAS
C = [];
V = [];
for ifile = 1:nfiles
disp(['Traitement du fichier n° ',sprintf('%d',ifile)])
probname = filelist(ifile).name;
probdate = filelist(ifile).date;
tmp=readmatrix([experience,'/',probname]);
RAIES = tmp(:,6);
DATAS = tmp(:,7);
C = [C; [RAIES]];
V = [V; [DATAS]];
end

Accepted Answer

Stephan
Stephan on 16 Apr 2020
use
C = [C, RAIES];
V = [V, DATAS];
instead
C = [C; RAIES];
V = [V; DATAS];
  2 Comments
Stephan
Stephan on 16 Apr 2020
my pleasure - you might want to accept useful answers in order to show others the questions answer worked for you.

Sign in to comment.

More Answers (0)

Categories

Find more on Creating and Concatenating Matrices in Help Center and File Exchange

Community Treasure Hunt

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

Start Hunting!