An N by N by N matrix code
2.900 visualizzazioni (ultimi 30 giorni)
Mostra commenti meno recenti
How do I code for NxNxN matrix using a letter.
0 Commenti
Risposta accettata
KSSV
il 22 Set 2025 alle 0:00
Modificato: MathWorks Support Team
il 22 Set 2025 alle 14:40
Questo/a risposta è stato/a segnalato/a da Walter Roberson
text(0.5,0.5,'D','FontSize',90,'Color','k')axis offI=frame2im(getframe(gcf));iwant = imresize(I,[50 50]) ;imshow(iwant)
4 Commenti
Spaceman
il 6 Mar 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.
Più risposte (2)
Walter Roberson
il 23 Set 2025 alle 4:24
N = 20; %for example
Letter = 'D'; %for example
Array3d = repmat(Letter, N, N, N);
0 Commenti
DGM
il 23 Set 2025 alle 19:18
For sake of ridiculousness:
N = double('d'); % using a letter
myarray = zeros(N,N,N); % a NxNxN array
size(myarray)
Yes, I did think about creating a volumetric image of a letter, but I'm lazy today.
0 Commenti
Vedere anche
Categorie
Scopri di più su Data Type Conversion in Help Center e File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!