필터 지우기
필터 지우기

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
KSSV
KSSV 2020년 10월 8일
What is s_code? In the answer..it is initialized ..so it cannot work...
Kanika Bhalla
Kanika Bhalla 2020년 10월 9일
Hi KSSV. Thanku for the response.Let me try something and will share the code with you.

댓글을 달려면 로그인하십시오.

추가 답변 (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
Ameer Hamza
Ameer Hamza 2020년 10월 8일
Can you share the value of s_code in a .mat file? Also, can you paste the code you tried running?
Kanika Bhalla
Kanika Bhalla 2020년 10월 9일
Hi Ameer Hamza. Thanku for the response.Let me try something and will share the code with you.

댓글을 달려면 로그인하십시오.

카테고리

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