Match function in matlab
Ältere Kommentare anzeigen
Hello,
I am looking for a function that corresponds to the excel "match" function.
I have an array of (n,32) where n is sated in for loop function as a number of completed loops (so it differs).
DataOutput = zeros(length(phiAStart:phiAStep:phiAEnd),32);
I would like to find the smallest value in column 32 (y) and get the corresponding value in column 1 (x) where y=f(x).
DataOutput(colector,1) = x;
DataOutput(colector,32) = y;
I can not resolve a function (to get x) having y because it's numerically calculated polynomial so I thought about something similar that MATCH function from excel.
Is there any similar function in Matlab or simple script that can be introduced?
I will be thankful for any suggestions or codes that may work.
Akzeptierte Antwort
Weitere Antworten (2)
Steven Lord
am 20 Feb. 2020
0 Stimmen
Call the min function with two outputs. Use the second output to retrieve the corresponding value.
1 Kommentar
Mateusz Brzezinski
am 20 Feb. 2020
Melissa Rosa
am 1 Mär. 2023
0 Stimmen
2x+4y
Kategorien
Mehr zu Loops and Conditional Statements finden Sie in Hilfe-Center und File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!