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
6 ビュー (過去 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!