Incorrect table size, unsure why.
Mostrar comentarios más antiguos
start_ROI = 1
stop_ROI = 9
bin = 180*60
start_time = 172827;
final_time = start_time + 259200;
for j = (start_ROI:stop_ROI)
%Table to hold frames moved data
Frames_movedabove = [];
Frames_movedbelow = [];
for i = (start_time:bin:final_time)
%Filter out respective thresholds and calculate total # frames moved
abovetest = asabove(i:(i+bin),j);
belowtest = sobelow(i:(i+bin),j);
%Create tables with total # frames moved above threshold
Frames_movedabove(length(Frames_movedabove)+1) = sum(abovetest);
Frames_movedbelow(length(Frames_movedbelow)+1) = sum(belowtest);
end
end
geno_1 = 1:9
for i = (start_time:bin:final_time)
Dummyabove = [];
Dummybelow = [];
%Filter out
Abovetable = asabove(i:(i+bin),geno_1);
Belowtable = sobelow(i:(i+bin),geno_1);
Dummyabove(length(Dummyabove)+1,:) = sum(Abovetable);
Dummybelow(length(Dummybelow)+1,:) = sum(Belowtable);
end
Hello,
I have some code I wrote for analyses that I have been tasked to do. My individual analysis code, above, works fine. I am able to go throughout all my RegionsOfInterest, per specified timeslot, and then graph it all.
When trying to recreate it for a population analysis, is when I run into issues. My idea was to go into my "overall data table", pull out only a genotype's worth of data (rather than simply 1 ROI-- in this case 1 genotype is ROIs 1:9), average out the values for each timeslot, and then graph the averages for a 25hr "every ROI in this genotype" graph. My main hiccup is thus: when I run the "individual" code, my Frames_movedabove/below tables are 1x25, which is what I want, as it's 1 data point per hour. However, my equivalent table for the population analysis, rather than being 9x25, is 1x9.
I attached a photo of what my final graph for individual analysis looks like. End goal is to output one like that, but for an entire population rather than simply 1 ROI. I am new to matlab so sorry if this is a trivial question and thanks in advance for the help.

1 comentario
However, my equivalent table for the population analysis
Which variable in your code represents this table? If it's Dummyabove and Dummybelow, you are discarding all of the results they contain every time you do this at the top of the loop,
Dummyabove = [];
Dummybelow = [];
In any case, this looks like the wrong approach if all you are trying to do is partition matrices into bins and average them, see my answer below.
Respuesta aceptada
Más respuestas (0)
Categorías
Más información sobre Logical en Centro de ayuda y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!
