Info
이 질문은 마감되었습니다. 편집하거나 답변을 올리려면 질문을 다시 여십시오.
i have created an array of color values of some images,how i insert the name of the images in the array
조회 수: 1 (최근 30일)
이전 댓글 표시
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
Geoff Hayes
2014년 6월 15일
편집: Geoff Hayes
2014년 6월 15일
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?
답변 (1개)
Image Analyst
2014년 6월 20일
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
댓글 수: 0
이 질문은 마감되었습니다.
참고 항목
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!