use of horzcat

2 visualizzazioni (ultimi 30 giorni)
Richard
Richard il 19 Giu 2012
What is the use of horzcat? Is there an advantage of using horzcat over manually concatenating arrays horizontally? for example:
A = {'a','b','c'};
B = {'d','e'};
C = horzcat(A,B);
This is the same as:
A = {'a','b','c'};
B = {'d','e'};
C = [A,B];
So, is there an advatage of using horzcat?

Risposta accettata

Jan
Jan il 20 Giu 2012
When you type [A, B] in the code, horzcat is called internally, as it is when it is called explicitely also. [.,.] is a synonym only.
cat(2, A, B) replies the same result, but as far as I remember it has a tiny difference in the runtime.
  1 Commento
rudolf
rudolf il 10 Lug 2012
Hello Jan
If i have several txt files on a folder instead of specify A, B, C,... how can i read all files inside a folder Im trying to use:
C=cat(1, F{:}) but is not working
Thanks rf

Accedi per commentare.

Più risposte (0)

Categorie

Scopri di più su Creating and Concatenating Matrices in Help Center e File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by