Plot function y=(sin(x))/x for pi/100<=x<=10pi using increments of pi/100

76 vues (au cours des 30 derniers jours)
How do we write in this on MATLAB?

Réponse acceptée

Sulaymon Eshkabilov
Sulaymon Eshkabilov le 27 Mar 2021
Modifié(e) : Sulaymon Eshkabilov le 27 Mar 2021
% Start rightaway by defining the variable x and compute it
x = pi/100:pi/100:10*pi;
y = sin(x)./x;
% plot
plot(x, y) % You may need to adjust plotted data line type, color, marker type, etc.

Plus de réponses (1)

Jan
Jan le 27 Mar 2021
Modifié(e) : Jan le 28 Mar 2021
"pi/100<=x<=10pi using increments of pi/100"
x = pi/100:pi/100:10*pi;
The rest is trivial. Please try it. In case of problems post your code and an explanation of the errors.
If you want to divide one vector by another one elementwise, use ./ instead of /
Did ypou read Matlab's Onramp already?
  3 commentaires
Alexander Ashari
Alexander Ashari le 27 Mar 2021
is it ./ or .\ ?
Sulaymon Eshkabilov
Sulaymon Eshkabilov le 27 Mar 2021
./ % Elementwise

Connectez-vous pour commenter.

Catégories

En savoir plus sur Line Plots dans Help Center et File Exchange

Tags

Community Treasure Hunt

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

Start Hunting!

Translated by