I am having a little trouble printing out colon values in a vector. For example:
This seems to work for me. However, what if the values for x do not start with 1?
For example what I have right now is this:
This produces a result like [0 0 0 ... 23 24 25 ... 78]. What I want to be able to do is start with 23 and end at 78 without the 0's; hence: [23 24 25 ... 77 78]. Any advice?
I am having a little trouble obtaining the mean values for y_coordinates in a rectangle. Currently, I am able to plot a rectangle about the centroid of a flower. What I want to do is use the impixel() command to obtain the RGB values - such that I can know the color. Since the x_values in the rectangle are same as the y_values change, mean(x_cood:x_cood + width) seems to work for me. However, I am unable to present the same for the y_cood. In other words, I want to be able to take the mean of all the y_coordindates at the x_coordinates such that I have an average of all the values within the rectangle. Then, I want to run the impixel() command. Here is what I have:
for U = 1:5:height
x_mean = mean(x_cood:x_cood + width);
y_mean = mean(y_cood + U);
rect_pixel = impixel(cam_image_rgb,x_mean,y_mean);
r = rect_pixel(1);
g = rect_pixel(2);
b = rect_pixel(3);
fprintf('Red = %0.2f, Green = %0.2f, Blue = %0.2f\n',r,g,b)