Kami_Munchkins
New Coder
Hi, i'm trying to plot a triangle wave through matlab using the equation, however i get an error in u=sin(2pi/t)
I want the time to be variable from -2pi to 2pi. I used a similar script to plot a sin wave and it worked fine. I'm kind of stuck on how the fix this

I want the time to be variable from -2pi to 2pi. I used a similar script to plot a sin wave and it worked fine. I'm kind of stuck on how the fix this

C:
clear all;
close all;
clc;
A = 2
t = -2*pi:pi/4000:2*pi
u = sin (2*pi/t);
g = (2*A/pi)*asin(u);
plot(t,g, 'linewidth',3)