How to replace number with string in a matrix

4 visualizaciones (últimos 30 días)
Ali Raza
Ali Raza el 24 de Ag. de 2022
Comentada: Lavanya el 14 de Sept. de 2022
I want to print like:
A =
1 1 1 1 1
1 1 1 1 1
1 1 Ali 1 1
1 1 1 1 1
1 1 1 1 1
but there are errors in my code:
for i = 1:5
for j = 1:5
A(i,j) = 1;
end
end
A

Respuesta aceptada

Geoff Hayes
Geoff Hayes el 24 de Ag. de 2022
Movida: Cris LaPierre el 24 de Ag. de 2022
@Ali Raza - if you wish to combine numeric values with strings, then I think that you would need to use a cell array.
  5 comentarios
Lavanya
Lavanya el 14 de Sept. de 2022
Here is the ''app1.mlapp'' file. This '.mlapp' file should work same as above the code. But its not working. Can you help me with this?

Iniciar sesión para comentar.

Más respuestas (0)

Categorías

Más información sobre Lighting, Transparency, and Shading en Help Center y File Exchange.

Etiquetas

Community Treasure Hunt

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

Start Hunting!

Translated by