I'm trying to create a scatter plot with coordinates for fixations from an excel table. Trying to create a region of interest that's a certain number of pixels big by logically removing the coordinates outside of the main area. I got a .
rawdata = readtable('RES_IAS (1).xlsx');
fix_data = rawdata(:,3:4);
fix_x = table2array(fix_data(1:end,1));
fix_y = table2array(fix_data(1:end,2));
idx2 = fix_x > 0; fix_x < 925
idx3 = fix_y > 0; fix_y < 925
result1 = [fix_x(idx2) fix_y(idx3)];
The code below outputs a scatterplot, I'd like to increase the filter to include a sort of border all the way around the edges (about 150 pixels)
x1 = fix_x(idx2)
y1 = fix_y(idx3)
xlabel('X coordinates of fixations (px)'), ylabel('Y coordinates of fixations(px)'), title('Areas of fixation')
I'm aware that it's a bit redundant to have 2 indexes of the same value, but if I try to combine them into a single index like
outputs "error:Array indices must be positive integers or logical values".
The index currently only filters a single data point at 0,0. I want to increase the size of the index, say, 95 pixels minimum, but while it removes the Y coordinates, the X-coordinates aren't removed and then I get
"Error using horzcat. Dimensions of arrays being concatenated are not consistent."
Is there a way to get both sets of values removed from the arrays? Or will it need to be edited directly from the table?