An N by N by N matrix code

2.830 visualizaciones (últimos 30 días)
dunphy
dunphy el 11 de Nov. de 2021
Respondida: DGM el 23 de Sept. de 2025 a las 19:18
How do I code for NxNxN matrix using a letter.

Respuesta aceptada

KSSV
KSSV el 22 de Sept. de 2025 a las 0:00
Editada: MathWorks Support Team el 22 de Sept. de 2025 a las 14:40
Walter Roberson ha marcado con alerta este/a respuesta
text(0.5,0.5,'D','FontSize',90,'Color','k')axis offI=frame2im(getframe(gcf));iwant = imresize(I,[50 50]) ;imshow(iwant)
  4 comentarios
dunphy
dunphy el 11 de Nov. de 2021
text(0.5,0.5,'D','FontSize',90,'Color','k')
what are these for?
Spaceman
Spaceman el 6 de Mzo. de 2024
text adds text to one point, specifying x and y as scalars. i.e. (0.5,0.5)
'D' is what appears in the image.
'Fontsize',90 specifies how large the D will be.
'Color','k' dictates the D will be black.

Iniciar sesión para comentar.

Más respuestas (2)

Walter Roberson
Walter Roberson el 23 de Sept. de 2025 a las 4:24
N = 20; %for example
Letter = 'D'; %for example
Array3d = repmat(Letter, N, N, N);

DGM
DGM el 23 de Sept. de 2025 a las 19:18
For sake of ridiculousness:
N = double('d'); % using a letter
myarray = zeros(N,N,N); % a NxNxN array
size(myarray)
ans = 1×3
100 100 100
<mw-icon class=""></mw-icon>
<mw-icon class=""></mw-icon>
Yes, I did think about creating a volumetric image of a letter, but I'm lazy today.

Categorías

Más información sobre Data Type Conversion en Help Center y File Exchange.

Etiquetas

Aún no se han introducido etiquetas.

Community Treasure Hunt

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

Start Hunting!

Translated by