how to declare

1 次查看(过去 30 天)
Pugazhendhi
Pugazhendhi 2012-2-10
Hi All,
I would like to declare the following code in Matlab.
r = 4/pi atan((R-G)/(R+G))
Any one please help.
Thanks,
Pugazh

采纳的回答

William
William 2012-2-10
Do you have the symbolic toolbox? If yes than
syms R G
r = 4/pi * atan((R-G)/(R+G));
else you're more than likely going to hve to define R and G in terms of domains. For example
R = 0:0.01:1;
G = 0:0.1:10; %Make sure the matrix dimensions agree.
r = 4/pi * atan((R-G)/(R+G));
Matrix manipulation is what matlab was designed to do at its basic level. the symbolic stuff is an add on that works pretty well.
  2 个评论
Walter Roberson
Walter Roberson 2012-2-10
Probably you meant
r = 4/pi * atan((R-G) ./ (R+G));
Pugazhendhi
Pugazhendhi 2012-2-11
Thanks, its working.

请先登录,再进行评论。

更多回答(0 个)

类别

Help CenterFile Exchange 中查找有关 Image Processing Toolbox 的更多信息

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by