Why does matlab not show the right graph?
조회 수: 1 (최근 30일)
이전 댓글 표시
if true
% code
clc;
close all;
clear all;
T=0.5; % time period
Ts=0.0005; %use 1000 points to produce one period (N=1000)
t=-1:Ts:1-Ts; % time axis
x=sawtooth(2*pi*0.2*(t-T/2)); % sawtooth function
plot(t,x)
grid on
end
I want to make bipolar sawtooth with period 0.5 s. It should turn out like this (same period, different amplitude with my question)
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/194012/image.png)
But,it turns out very different on matlab
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/194014/image.png)
My problems are: 1. Is there anything wrong with my code? 2. How to know make plot with more detail like the graph on the left side?
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/194016/image.png)
댓글 수: 0
답변 (1개)
Image Analyst
2018년 8월 18일
Multiply sawtooth() by 3 to change the amplitude.
In (t-T/2), adjust the amount you add or subtract to shift the waveform left or right.
댓글 수: 0
참고 항목
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!