How to concatenate horizontaly and not vertically

2 Ansichten (letzte 30 Tage)
Merlin Piron
Merlin Piron am 16 Apr. 2020
Kommentiert: Stephan am 16 Apr. 2020
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

Akzeptierte Antwort

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

Melden Sie sich an, um zu kommentieren.

Weitere Antworten (0)

Kategorien

Mehr zu Creating and Concatenating Matrices finden Sie in Help Center und File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by