use of horzcat

2 次查看(过去 30 天)
Richard
Richard 2012-6-19
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?

采纳的回答

Jan
Jan 2012-6-20
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 个评论
rudolf
rudolf 2012-7-10
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

请先登录,再进行评论。

更多回答(0 个)

类别

Help CenterFile Exchange 中查找有关 Creating and Concatenating Matrices 的更多信息

标签

Community Treasure Hunt

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

Start Hunting!

Translated by