I want to plot an integral function, if 'y' is an arbitrary vector ,
N=51;
I=@(x)norm(exp(-1i*pi*x)- y'.*exp(-1i*pi*x*(0:(N-1)))).^2;
F=integral(I,-1,1,'ArrayValued',true);
plot(F);
This what I've tried, but it's not working.

 채택된 답변

Star Strider
Star Strider 2018년 5월 6일

1 개 추천

I am not certain what you want.
Try this:
N = 51;
I = @(x,y) norm(exp(-1i*pi*x)- y'.*exp(-1i*pi*x*(0:(N-1)))).^2;
F = @(y) integral(@(x) I(x,y), -1, 1,'ArrayValued',true);
y = 1:10;
Fy = arrayfun(F, y);
figure(1)
plot(y, Fy)
grid

댓글 수: 1

Fanzheng Liu
Fanzheng Liu 2021년 11월 13일
Thank you so much for your code... It really really helped me A LOT!!! 🥺🥺🥺

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

추가 답변 (0개)

카테고리

도움말 센터File Exchange에서 MATLAB에 대해 자세히 알아보기

질문:

2018년 5월 6일

댓글:

2021년 11월 13일

Community Treasure Hunt

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

Start Hunting!

Translated by