use of horzcat

3 visualizaciones (últimos 30 días)
Richard
Richard el 19 de Jun. de 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?

Respuesta aceptada

Jan
Jan el 20 de Jun. de 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 comentario
rudolf
rudolf el 10 de Jul. de 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

Iniciar sesión para comentar.

Más respuestas (0)

Categorías

Más información sobre Creating and Concatenating Matrices en Help Center y File Exchange.

Etiquetas

Community Treasure Hunt

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

Start Hunting!

Translated by