how to write equation in matlab ??

739 views (last 30 days)
ajeet verma
ajeet verma on 7 Aug 2017
Answered: Meghan van Rooyen on 30 Nov 2021
equations and corresponding graph is given in attached file and i am trying like this but unable to find second graph where is wrong,, please help
%reflection function
s = @(x) (1-0.4*(cos(x/100))).*(0<=x & x<=511);
x = linspace(0, 500);
R = s(x);
figure(1)
plot(x,R)
axis([xlim 0 1.5])
% intensity function
f=1/20;
x = linspace(0, 500);
I=@(x) (R(x).*sin(2*pi*f*x));
plot(x,I)
axis([xlim 0 1.5])

Accepted Answer

Torsten
Torsten on 7 Aug 2017
I=@(x) s(x).*sin(2*pi*f*x);
plot(x,I(x))
Best wishes
Torsten.
  8 Comments

Sign in to comment.

More Answers (4)

Al Hossain
Al Hossain on 13 Jul 2019
f.JPG
can any one write this form in mat lab

Valerie Cando
Valerie Cando on 14 Jan 2021
For Sheet 1, Creating Formulas:
1. 10 (A1) + 2 (B1) = __ (C1)
2. 10 (A2) - 2 (B2) = __ (C2)
3. 10 (A3) x 2 (B3) = __ (C3)
4. 10 (A4) / 2 (B4) = __ (C4)
5. 10 (A5) ^ 2 (B5) = __ (C5)

Meghan van Rooyen
Meghan van Rooyen on 30 Nov 2021
-2xsin(x^2)+cos(x^2)-((e^sqrt(x))/2sqrt(x))+3x^2-8x=0

Meghan van Rooyen
Meghan van Rooyen on 30 Nov 2021
-2x^2sin(x^2)+cos(x^2)-((e^sqrt(x))/2sqrt(x))+3x^2-8x=0

Community Treasure Hunt

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

Start Hunting!