An N by N by N matrix code
조회 수: 2,930 (최근 30일)
이전 댓글 표시
채택된 답변
KSSV
2025년 9월 22일 0:00
편집: MathWorks Support Team
2025년 9월 22일 14:40
이 답변에 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
Spaceman
2024년 3월 6일
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.
추가 답변 (2개)
Walter Roberson
2025년 9월 23일 4:24
N = 20; %for example
Letter = 'D'; %for example
Array3d = repmat(Letter, N, N, N);
댓글 수: 0
DGM
2025년 9월 23일 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
참고 항목
카테고리
Help Center 및 File Exchange에서 Data Type Conversion에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!