MATLAB Answers

How can I turn the following matrix into an image?

2 views (last 30 days)
erfan nori
erfan nori on 22 Jan 2021
Commented: erfan nori on 25 Jan 2021
Hi, I have generated a matrix using the chaos function as follows. Now I want to convert this matrix to a color image with dimensions of 16 x 16 pixels.
for i=2:n
Help me please

Answers (1)

Constantino Carlos Reyes-Aldasoro
Well, an image of 16 rows, 16 columns would have 256 pixels. That would be the first consideration, after running your code you have the following:
>> whos
Name Size Bytes Class Attributes
i 1x1 8 double
n 1x1 8 double
r 1x1 8 double
x 1x6144 49152 double
So, x has 6,144 elements. How would you go from there to 16x16? You may discard, average or many other techniques, but I guess that you need to sort out first the dimensions.
erfan nori
erfan nori on 25 Jan 2021
I will find a very good solution myself, thank you for your efforts

Sign in to comment.

Community Treasure Hunt

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

Start Hunting!

Translated by