Filter löschen
Filter löschen

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

1 Ansicht (letzte 30 Tage)
for i=1:100
s_code1(i)=strcat(s_code(2*i-1,:),s_code(2*i,:));
end
c1=cross(s_code1,100);

Akzeptierte Antwort

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

Melden Sie sich an, um zu kommentieren.

Weitere Antworten (1)

Ameer Hamza
Ameer Hamza am 8 Okt. 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 Kommentare
Ameer Hamza
Ameer Hamza am 8 Okt. 2020
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 am 9 Okt. 2020
Hi Ameer Hamza. Thanku for the response.Let me try something and will share the code with you.

Melden Sie sich an, um zu kommentieren.

Kategorien

Mehr zu Environment and Settings finden Sie in Help Center und File Exchange

Tags

Produkte

Community Treasure Hunt

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

Start Hunting!

Translated by