Extract datapoint corresponding to index from maximum of an array
Show older comments
I need to extract the force corresponding to the maximum strain for every cycle count from the attached file.
data=xlsread('Sample Data.xlsx');
count=data(:,1);
strain=data(:,2);
force=data(:,3);
unique_counts=unique(count);
maxforce=zeros(size(unique_counts));
maxstrain=zeros(size(unique_counts));
for n=1:numel(unique_counts)
c=unique_counts(n);
rows=ismember(count,c);
strain_=strain(rows);
force_=force(rows);
maxstrain(n)=max(strain_);
%% Here is where I need input
maxforce(n)= ?
end
Thank you
Accepted Answer
More Answers (0)
Categories
Find more on Resizing and Reshaping Matrices 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!