how can I plot y = (cos(t-2)/4)(rect(t+1)/6 )?

3 vues (au cours des 30 derniers jours)
SaiRevan Potharaju
SaiRevan Potharaju le 3 Août 2022
Modifié(e) : Jan le 3 Août 2022
y = [(1-cos(0.25*(t-2).^2))*rect(t+1,6)]
is it correct way to write tht code ?
  1 commentaire
Jan
Jan le 3 Août 2022
Modifié(e) : Jan le 3 Août 2022
The brackets [ and ] are the concatenation operator in Matlab. What do you concatenate?
The shown code does not allow to plot anything, so how could it be correct?
What is "rect"? Why do you convert "rect(t+1)/6" to "rect(t+1,6)" ?
"cos(t-2)/4" differs from "1-cos(0.25*(t-2).^2)" also. Very strange.

Connectez-vous pour commenter.

Réponses (2)

Adam Danz
Adam Danz le 3 Août 2022
is it correct way to write tht code ?
The line of code looks functional without knowing any other details including what rect is.
how can I plot y = (cos(t-2)/4)(rect(t+1)/6 )?
Define t, compute y, and plot(t,y)

Jan
Jan le 3 Août 2022
y = @(t) cos(t-2) / 4 .* rect(t + 1) / 6;
fplot(y)

Catégories

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

Community Treasure Hunt

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

Start Hunting!

Translated by