I need to create letter K with 20 pixel by 20 pixel by plotting

2 visualizaciones (últimos 30 días)
Just start MatLab, I can plot the letter on 5x5 matrix but a 20x20 is to much
  2 comentarios
John Doe
John Doe el 13 de Nov. de 2019
Editada: John Doe el 13 de Nov. de 2019
Hello, I figured out how to plot a letter using these scripts
n = 5; % size of matrix
x = [2 2 2 3 4 4 4 ]; % x-coordinate
y = [1 2 3 2 2 3 1 ] ; % y-coordinate
y_new = n - y; % upside down for y-coordinate
plot(x,y_new,'o','MarkerEdgeColor','b','MarkerFaceColor','b','MarkerSize',12), axis([0 n 0 n]), axis square, grid on;
Can you help me rotate this letter 90 degrees using transformation matrix.

Iniciar sesión para comentar.

Respuesta aceptada

KALYAN ACHARJYA
KALYAN ACHARJYA el 13 de Nov. de 2019
Editada: KALYAN ACHARJYA el 13 de Nov. de 2019
"Now I want to know how to rotate this letter 90 degrees"
n=5; % size of matrix
x=[2 2 2 3 4 4 4 ]; % x-coordinate
y=[1 2 3 2 2 3 1 ] ; % y-coordinate
y_new=n-y; % upside down for y-coordinate
figure,plot(x,y_new,'o','MarkerEdgeColor','b','MarkerFaceColor','b','MarkerSize',12), axis([0 n 0 n]), axis square, grid on;
figure,plot(y_new,x,'o','MarkerEdgeColor','b','MarkerFaceColor','b','MarkerSize',12), axis([0 n 0 n]), axis square, grid on;
  4 comentarios
John Doe
John Doe el 13 de Nov. de 2019
I need to use some kind of linear transformation matrix to rotate the image.
KALYAN ACHARJYA
KALYAN ACHARJYA el 13 de Nov. de 2019
linear transformation? Please illustrate with example

Iniciar sesión para comentar.

Más respuestas (0)

Categorías

Más información sobre 3-D Scene Control 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