Unable to perform assignment because the left and right sides have a different number of elements.

1 次查看(过去 30 天)
for i=1:100
s_code1(i)=strcat(s_code(2*i-1,:),s_code(2*i,:));
end
c1=cross(s_code1,100);

采纳的回答

KSSV
KSSV 2020-10-8
编辑:KSSV 2020-10-8
s_code = cell(100,1);
for i=1:100
s_code1{i}=strcat({s_code{2*i-1},s_code{2*i});
end
  5 个评论

请先登录,再进行评论。

更多回答(1 个)

Ameer Hamza
Ameer Hamza 2020-10-8
If you are using R2016b or later, you can also try the following
s_code1 = strings(1, 100)
for i=1:100
s_code1(i)=strcat(s_code(2*i-1,:),s_code(2*i,:));
end
  3 个评论

请先登录,再进行评论。

类别

Help CenterFile Exchange 中查找有关 Environment and Settings 的更多信息

标签

产品

Community Treasure Hunt

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

Start Hunting!

Translated by