Info

This question is closed. Reopen it to edit or answer.

i have created an array of color values of some images,how i insert the name of the images in the array

1 view (last 30 days)
black = length(darks)/pixels;
white = length(lights)/pixels;
red = length(find((h >.9167 | h <=.083) & h~=-1))/pixels;
yellow=length(find(h >.083 & h<=.25))/pixels;
green=length(find(h > .25 & h<= .4167))/pixels;
cyan= length(find(h > .4167 & h<= .5833))/pixels;
blue=length(find(h > .5833 & h <= .75))/pixels;
magenta=length(find(h > .75 & h <= .9167))/pixels;
disp('Red=')
disp(red)
disp('Blue=')
disp(blue)
a(i,1)=red
a(i,2)=green
a(i,3)=blue
a(i,4)=yellow
a(i,5)=cyan
a(i,6)=magenta
a(i,7)=black
a(i,8)=white
end
dlmwrite('frs.mat',a)
b=dlmread('frs.mat')
  1 Comment
Geoff Hayes
Geoff Hayes on 15 Jun 2014
Edited: Geoff Hayes on 15 Jun 2014
Luna - it is not all that clear what you are asking, and the code above is unreadable and incomplete. Please edit your question, highlight the code and press the {}Code button. The alternative is to just attach your script or function m-file to your question.
And please clarify what you are asking - what are the image names? Are they the variables (red,hello,green,etc.) in the above code, or something else?

Answers (1)

Image Analyst
Image Analyst on 20 Jun 2014
To combine numbers and strings in the same variable, you'll have to use a cell array or a table. For more on cell arrays, see the FAQ: http://matlab.wikia.com/wiki/FAQ#What_is_a_cell_array.3F

This question is closed.

Tags

Community Treasure Hunt

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

Start Hunting!