Change the value of independent variables to solve the dependent variable equation

조회 수: 4 (최근 30일)
x=0:0.5:4*pi;
y=sin(x)+cos(x);
display(y);
In the above example the y(x) is given . Now i want to use y(Ax) in other equations (where A is some constant or variable) without hampering the original x values.
Please tell me how to do it.

채택된 답변

darova
darova 2021년 7월 29일
Use function handle
x = 0:.1:10;
f = @(a) sin(a*x);
plot(x,f(2),'r')
line(x,f(5))

추가 답변 (1개)

KSSV
KSSV 2021년 7월 29일
x=0:0.5:4*pi;
y=sin(x)+cos(x);
xi = x(2)*rand ;
yi = interp1(x,y,xi) ;
plot(x,y,'r',xi,yi,'*b')
  댓글 수: 1
Deepro Bardhan
Deepro Bardhan 2021년 7월 29일
Sir I wanted y(Ax) which means it will evaluate
sin(Ax)+cos(Ax)
I didnt ask for the interpolation of a certain value of x.

댓글을 달려면 로그인하십시오.

카테고리

Help CenterFile Exchange에서 Multirate Signal Processing에 대해 자세히 알아보기

제품


릴리스

R2016a

Community Treasure Hunt

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

Start Hunting!

Translated by