Undefined function 'concat' for input arguments of type 'double'.

4 次查看(过去 30 天)
I am getting this error while running the following code. 'Undefined function 'concat' for input arguments of type 'double'.'
load train.mat; y1=y; load handel.mat; y2=y; load gong.mat; y3=y; concat(y1,y2,y3);

回答(1 个)

TADA
TADA 2018-11-11
The error message pretty much sums it up. You can't concat arguments of type double.
If you are trying to create a vector, use either the bracket syntax
v1 = [y1, y2, y3] % for a row vector (commas aren't mandatory)
v2 = [y1; y2; y3] % for column vector (semicolons are mandatory)
or you can use the equivalent functions vertcat or horzcat
If you're trying to generate a string, you must first convert them to strings
str = strcat(num2str(y1), num2str(y2), num2str(y3));
% or use brackets to concat the character vectors
str = [num2str(y1), num2str(y2), num2str(y3)] % again commas aren't necessary
% or the equivalent function call:
str = horzcat(num2str(y1), num2str(y2), num2str(y3));

类别

Help CenterFile Exchange 中查找有关 Large Files and Big Data 的更多信息

标签

Community Treasure Hunt

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

Start Hunting!

Translated by