How to find the minimum Error when the position is known?

3 views (last 30 days)
I know the position at which the value of Error is minimum. Is their a command to know the value of Error also?
clear all; close all; clc;
PHI=0:0.1:2*pi;
Error=[1.1995 1.2002 1.2007 1.2010 1.2011 1.2010 1.2007 1.2003 1.1996 1.1988 1.1978 1.1967 1.1954 1.1940 1.1924]
position=find(Error==min(Error))
phi0=PHI(position)

Accepted Answer

Willie Smit
Willie Smit on 8 Sep 2021
PHI=0:0.1:2*pi;
Error=[1.1995 1.2002 1.2007 1.2010 1.2011 1.2010 1.2007 1.2003 1.1996 1.1988 1.1978 1.1967 1.1954 1.1940 1.1924];
[minValue, position] = min(Error); % minValue contains the minimum value in Error
phi0=PHI(position);

More Answers (0)

Categories

Find more on MATLAB 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!