Info

이 질문은 마감되었습니다. 편집하거나 답변을 올리려면 질문을 다시 여십시오.

multiplying vectors (easy one!)

조회 수: 1 (최근 30일)
Paul Rogers
Paul Rogers 2020년 6월 11일
마감: MATLAB Answer Bot 2021년 8월 20일
Sorry guys, an easy question:
how do I evaluete this function in the interval
x=[-0.2,0.8]
the function is f = 2.2785*T_0(x) - 0.2142*T_1(x) - 0.3595*T_2(x) - 0.1793*T_3(x) + 0.1810*T_4(x)
where T_k(x)=cos*(k*cos^-1(x))
c =
2.2785
-0.2142
-0.3595
-0.1793
0.1810

답변 (1개)

KSSV
KSSV 2020년 6월 11일
m = 100 ;
x = linspace(-0.2,0.8,m) ;
Evaluate the function for every value of x. Read about element by element operations.
  댓글 수: 3
KSSV
KSSV 2020년 6월 11일
Yes you can use that too.....two ways
  1. Fix the number of discretozations use linspace
  2. Fix the step size and ise : .
Paul Rogers
Paul Rogers 2020년 6월 11일
thanks, but how do I write the rest?
f(x=0)=2.2785*T_0(x) - 0.2142*T_1(x) - 0.3595*T_2(x) - 0.1793*T_3(x) + 0.1810*T_4(x)
where for x=0 (i.e)
T_0(x=0)=cos*(0*cos^-1(x))
T_1(x=0)=cos*(1*cos^-1(x))
T_2(x=0)=cos*(2*cos^-1(x))
T_3(x=0)=cos*(3*cos^-1(x))
T_4(x=0)=cos*(4*cos^-1(x))
or x=-0.2
T_0(x=-0.2)=cos*(0*cos^-1(x))
T_1(x=-0.2)=cos*(1*cos^-1(x))
T_2(x=-0.2)=cos*(2*cos^-1(x))
T_3(x=-0.2)=cos*(3*cos^-1(x))
T_4(x=-0.2)=cos*(4*cos^-1(x))
c =
2.2785
-0.2142
-0.3595
-0.1793
0.1810
and
x = [-0.2:0.01:0.8];

제품


릴리스

R2014b

Community Treasure Hunt

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

Start Hunting!

Translated by