Undefined function 'sind' for input arguments of type 'sym'.

14 ビュー (過去 30 日間)
Tom
Tom 2014 年 3 月 7 日
コメント済み: Walter Roberson 2017 年 9 月 17 日
Hello,
Is it not express a symbolic trigonometric function in degrees? It would save me a lot of converting if it is.
Kind regards,
Tom
  2 件のコメント
NARESH BILONIYA
NARESH BILONIYA 2017 年 9 月 17 日
編集済み: Walter Roberson 2017 年 9 月 17 日
n = [ 7 1 9 14 12 ]
% n1 = randi([0 , 1],5,4) method 2
x = de2bi(n) ;
L1 = numel(x) ;
y = fliplr(x)
syms p1 ;
syms p2 ;
syms p3 ;
q1 = [p1; p1; p1; p1; p1 ] ;
q2 = [p2; p2; p2; p2; p2 ] ;
q3 = [p3; p3; p3; p3; p3 ] ;
c = [q1 q2 y(:,1) q3 y(:,2:4) ]
c(4,2)
for I=1:5
for J=3:2:5
if xor( c(I,J),c(I,J+2) ) ==0
c(I,1)=0
else
c(I,1)=1
end
end
end
i am getting
" ??? Undefined function or method 'xor'
for input arguments of type 'sym'.
Error in ==> Untitled2 at 39
if xor( c(I,J),c(I,J+2) ) ==0
"
how to solve it ??
Image Analyst
Image Analyst 2017 年 9 月 17 日
Try NOT making p1,p2,p3 syms, and just assign some actual values to them.

サインインしてコメントする。

回答 (1 件)

Mischa Kim
Mischa Kim 2014 年 3 月 7 日
編集済み: Mischa Kim 2014 年 3 月 7 日
Yep, you need to use sin. Convert angles in degrees to rad via
angle_rad = angle_deg * (pi/180);
As an example
syms t
a = sin(t);
double(subs(a,t,90*(pi/180)))
ans =
1
  1 件のコメント
Walter Roberson
Walter Roberson 2017 年 9 月 17 日
sind = @(ang) sin(ang * sym('pi') / sym(180))

サインインしてコメントする。

カテゴリ

Help Center および File ExchangeNumber Theory についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by