Can you provide the triangular wave function? Once you have that, we can determine the translational shift on the x-axis.
Transport delay generate to matlab function
조회 수: 2 (최근 30일)
이전 댓글 표시
답변 (1개)
Sam Chak
2025년 2월 21일
Hi @Enes
I applied the modulo operation to the triangular membership function from the Fuzzy Logic Toolbox to create the equilateral triangular wave. You can adjust the base length (period) and the phases to suit your application. Personally, I prefer the trimf() function, but you may also use the sawtooth() function. If you would like to create your own version of the triangular function, please replace the trimf() function accordingly. The MATLAB Function block should support the mod(), trimf(), and sawtooth() functions.
t = linspace(0, 4*sqrt(3), 7001);
p = 2/sqrt(3); % period (base length of Equilateral triangle)
z1 = mod(t - 0*p/4, p); % modulo operation
z2 = mod(t - 1*p/4, p);
z3 = mod(t - 2*p/4, p);
z4 = mod(t - 3*p/4, p);
y1 = trimf(z1, [0*p 1*p/2 1*p]); % blue
y2 = trimf(z2, [0*p 1*p/2 1*p]); % red
y3 = trimf(z3, [0*p 1*p/2 1*p]); % orange
y4 = trimf(z4, [0*p 1*p/2 1*p]); % purple
plot(t, [y1; y2; y3; y4]), grid on, axis equal
xlabel('Time'), ylabel('Amplitude')
댓글 수: 2
참고 항목
카테고리
Help Center 및 File Exchange에서 Axis Labels에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!


