Borrar filtros
Borrar filtros

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

1 visualización (últimos 30 días)
for i=1:100
s_code1(i)=strcat(s_code(2*i-1,:),s_code(2*i,:));
end
c1=cross(s_code1,100);

Respuesta aceptada

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

Iniciar sesión para comentar.

Más respuestas (1)

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

Iniciar sesión para comentar.

Categorías

Más información sobre Environment and Settings en Help Center y File Exchange.

Etiquetas

Productos

Community Treasure Hunt

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

Start Hunting!

Translated by