Problem with Create Matrix

2 次查看(过去 30 天)
Dani D
Dani D 2015-10-27
编辑: Thorsten 2015-10-27
Hello, Why this command doesn't work? FD = [1:10 ; 50:60]

采纳的回答

Thorsten
Thorsten 2015-10-27
编辑:Thorsten 2015-10-27
Because
Error using vertcat
CAT arguments dimensions are not consistent.
You have 10 numbers in the first row, and try to conCAT vertically 11 numbers in the second row. That's not possible in a matrix, all rows must have the same number of columns.
You can use a cell array
FD{1} = 1:10; FD{2} = 50:60;
or you have to change the numbers, like
FD = [1:10; 51:60];
  2 个评论
Dani D
Dani D 2015-10-27
Thanks , but i have the below error.
>> FD{1} = 1:10; F{2} = 50:60;
Cell contents assignment to a non-cell array object.
Thorsten
Thorsten 2015-10-27
编辑:Thorsten 2015-10-27
Use
clear FD
FD{1} = 1:10; FD{2} = 50:60;
and note that the second assignement should be FD{2}, not F (my typo, I corrected it above).

请先登录,再进行评论。

更多回答(0 个)

类别

Help CenterFile Exchange 中查找有关 Logical 的更多信息

标签

Community Treasure Hunt

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

Start Hunting!

Translated by