Effacer les filtres
Effacer les filtres

Info

Cette question est clôturée. Rouvrir pour modifier ou répondre.

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

1 vue (au cours des 30 derniers jours)
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 commentaire
Geoff Hayes
Geoff Hayes le 15 Juin 2014
Modifié(e) : Geoff Hayes le 15 Juin 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?

Réponses (1)

Image Analyst
Image Analyst le 20 Juin 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

Cette question est clôturée.

Tags

Community Treasure Hunt

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

Start Hunting!

Translated by