Clear Filters
Clear Filters

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

1 view (last 30 days)
for i=1:100
s_code1(i)=strcat(s_code(2*i-1,:),s_code(2*i,:));
end
c1=cross(s_code1,100);

Accepted Answer

KSSV
KSSV on 8 Oct 2020
Edited: KSSV on 8 Oct 2020
s_code = cell(100,1);
for i=1:100
s_code1{i}=strcat({s_code{2*i-1},s_code{2*i});
end
  5 Comments

Sign in to comment.

More Answers (1)

Ameer Hamza
Ameer Hamza on 8 Oct 2020
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 Comments

Sign in to comment.

Categories

Find more on Environment and Settings in Help Center and File Exchange

Tags

Products

Community Treasure Hunt

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

Start Hunting!