WHich loops or command should i use in order to plot this equation? It has 3 variables: v,x,t
조회 수: 2 (최근 30일)
이전 댓글 표시
답변 (1개)
Mehmed Saad
2020년 4월 15일
편집: Mehmed Saad
2020년 4월 15일
define x,t of same length i.e. select a sampling rate
fs = 10;%Hz
Now define time
t = 0:1/fs:100-1/fs;
x = linspace(0,2*pi,length(t));
i_t = 1.414*sin(w*t+phi);
Now Run the for loop for t
i = 1:length(x)
Now index 1 by 1 and sum them
Remember there are two nested for loop, 1 is for v and other for t
댓글 수: 2
Mehmed Saad
2020년 4월 16일
- yes you need another loop for x
- you can nest for loop as x t and v or t x and v
- You should follow nyquist rate as your frequency is 60Hz so you need atleast 120Hz fs
- x size can differ from t, it is not necessary
참고 항목
카테고리
Help Center 및 File Exchange에서 Creating and Concatenating Matrices에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!