image processing, data stimulation

1 visualización (últimos 30 días)
mohammed abdul wadood
mohammed abdul wadood el 19 de Mzo. de 2018
Comentada: mohammed abdul wadood el 19 de Mzo. de 2018
hi, i want to generation an matrix that simulate an image of size 198*211*3 so i used this code:
clc
close all
clear all
for i=1:4;
for j=1:4;
x(i,j)=rand*100;
if x(i,j)>=0 && x(i,j)<=255;
x
end
end
end
is this work correct? thank you
  1 comentario
Walter Roberson
Walter Roberson el 19 de Mzo. de 2018
Code that includes "clear all" is almost never correct.

Iniciar sesión para comentar.

Respuesta aceptada

Walter Roberson
Walter Roberson el 19 de Mzo. de 2018
x = randi([0 255], 198, 211, 3, 'uint8');
  1 comentario
mohammed abdul wadood
mohammed abdul wadood el 19 de Mzo. de 2018
in facet i used this solution like this:
x=randi([0 255],198,211)
but I thought it's wrong; but now you Improve it in your solution, thank you sir, thank you so much.

Iniciar sesión para comentar.

Más respuestas (0)

Categorías

Más información sobre Image Processing Toolbox 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