COMPGROUPS.NET | Search | Post Question | Groups | Stream | About | Register

### arg function in matlab

• Email
• Follow

```we have to calculate least square estimate for geometrical transformation as follows

r=unit matrix
t=0
v = (i-(r*j)-t);
s=(norm(v).^2);

[r t]=arg( min(sum(s)));

how to use <arg> in matlab?.
```
 0

See related articles to this posting

```"vidya " <vidya90rv@gmail.com> wrote in message <ik7flv\$jl\$1@fred.mathworks.com>...
> we have to calculate least square estimate for geometrical transformation as follows
>
> r=unit matrix
> t=0
> v = (i-(r*j)-t);
> s=(norm(v).^2);
>
> [r t]=arg( min(sum(s)));
>
> how to use <arg> in matlab?.

What your arg function intend to perform? What inputs it takes and what outputs it gives?
Yumnam Kirani Singh
Tronglaobi Awang Leikai
```
 0

```On 24/02/11 11:45 PM, vidya wrote:
> we have to calculate least square estimate for geometrical
> transformation as follows
>
> r=unit matrix
> t=0
> v = (i-(r*j)-t);
> s=(norm(v).^2);
>
> [r t]=arg( min(sum(s)));
>
> how to use <arg> in matlab?.

In non-vectorized form:

function a = argument(z)
re = real(z);
im = imag(z);
if im
if re
a = arctan(im/re);
else
a = sign(im) * pi/2;
end
else
if re < 0
a = pi;
else
a = 0;
end
end
end

There may well be a simpler way; I worked this up from the definition.
```
 0

```1) 0<=3Dt<255 is lower limit to argmax. how to use this in matlab coding. 2=
) before this the variable h(t),w(t)should be in these variables or it can =
be replaced by any other variable.. because i initialised for h(t) is p(thr=
esh) and for w(t) is temp1. pls answer for these two questions.
```
 0
Reply sheeba261991 (1) 9/5/2013 10:08:12 AM

```
<sheeba261991@gmail.com> wrote in message
> 1) 0<=t<255 is lower limit to argmax. how to use this in matlab coding. 2)
> before this the variable h(t),w(t)should be in these variables or it can
> be replaced by any other variable.. because i initialised for h(t) is
> p(thresh) and for w(t) is temp1. pls answer for these two questions.

Are you using the ARGMAX function from this File Exchange submission?

http://www.mathworks.com/matlabcentral/fileexchange/24210-argmaxargmin

Rather than doing that, if you have the expression you want to minimize
stored as data, call MAX with two outputs.

x = randperm(10)
[maxValue, maxValueLocation] = max(x)

maxValue will be 10 and x(maxValueLocation) will be 10.

--
Steve Lord
slord@mathworks.com
http://www.mathworks.com

```
 0
Reply slord (13686) 9/5/2013 1:28:48 PM

4 Replies
730 Views

Similar Articles

11/30/2013 3:11:17 PM
page loaded in 213161 ms. (0)