how to declare

조회 수: 1 (최근 30일)
Pugazhendhi
Pugazhendhi 2012년 2월 10일
편집: Matthew Crema 2013년 10월 8일
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