Info
この質問は閉じられています。 編集または回答するには再度開いてください。
i have created an array of color values of some images,how i insert the name of the images in the array
3 ビュー (過去 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!