MATLAB: How to select the x-value of the maximum of a figure (without using ginput) homework I've got a figure (see attachment). I want to select the x-value of it's maximum. How do I do this? Best Answer I would use the max function with two output arguments, then use the index value to find the x-value:[ymax,idx] = max(y);xmax = x(idx); Related SolutionsMATLAB: Find X-value given Y The ‘x’ and ‘y’ vectors were not the same sizes, so I added 25 to ‘x’, then added a small amount to the duplicated element in ‘y’ and did the interpolation:x = [25 50 100 200 500 1000 2000 5000 10000 20000];y = [ -0.1755 -0.1755 -0.9151 -2.8534 -8.4043 -13.1515 -20.0000 -27.5350 -33.9794 -40.0000];dy = diff([0 y]);dyix = find(dy == 0);y(dyix) = y(dyix-1)+1E-8;xint = interp1(y, x, -10); % Find The Value Of ‘x’ Corresponding To y=-10’ MATLAB: How to make a function that shows the minimum value and index of that original minimum value without the “min()” function [minx,idx]=mynotverycleverhomeworkminfunction(x) [s,is]=sort(x); minx=s(1); idx=is(1);More to the point, what have you done so far and where, specifically, did you get stuck by Matlab? Related QuestionHow to look for minimum value in a vector from backwardsFind minimum y-value and x-valueHow to interactively find the statistics of the zoomed in data in a plot in MATLAB 7.7 (R2008b)Interpolate Data and find the matching x-ValueMax value
Best Answer