- Attach a portion of the file people can see to do something with -- I can't begin to even read that image.
- Use readtable to make a table--_much_ more handy to pick data from by variable name instead of just positions (presuming the headings which I can't read are different variables).
- See ismember() to select subsets or use findgroups to process by criteria of choice.
I need to write a for loop so that my script analyses every 3rd column in my data
2 views (last 30 days)
Show older comments
Hi,
Basically I have a huge amount of data, which I am writing a script for.
Essentially, i am trying to create 3 graphs per pH value at different wavelengths.
I have this so far:
Direc=dir("c:/Users/Documents") %determine directory
FileName=xlsread("Exp1FApHluorinTEST.xlsx") %determine file name
T=(0:8:1072);%vector of time from 0-1072 with 8 min interval
Dat=[];
Ave=[]
j=1;
[rows,cols]=size(FileName);
I have a data set which looks like this, I know it's a lot, sorry
Essentially, I want to create a graph, I know how to do this, but I do not know how to create a for/if loop to take all the information from 395nm for the entire dataset at each timepoint, and for each condition.
There are 135 readings for each wavelength, and essentially the conditions are tested in triplicate, so I have a rough code of what I used previously which is:
for i=1:cols;
if mod(i,2)==0;
Dat(:,j)=FileName(:,i);
j=j+1;
end
end
for j=1:(cols/2)
for i=1:(rows/3)
Ave(i,j)=mean([Dat((3*i-2),j) Dat((3*i-1),j) Dat((3*i),j) ]);
end
end
Though this is for a different data set where I required only the use of every other column, and then averaging of the 3 rows across that column, now I need every column.
If this makes sense, could someone please help me.
Thank you
8 Comments
dpb
on 3 Jun 2019
I got pulled away on farm activities (the cows have to drink), sorry... :)
So, to see if I got this, you're looking for 8 plots versus time with each of the four groups of three for a given group averaged over the repetitions?
Are the three wavelengths parameterized on each plot or are there then 8*3==>24 plots in total?
Answers (0)
See Also
Categories
Find more on Bar Plots in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!