필터 지우기
필터 지우기

how to store every value that i get from each iteration of for loop ?

조회 수: 3 (최근 30일)
Muhammad
Muhammad 2022년 9월 17일
편집: Torsten 2022년 9월 17일
i want to store all values of an but my code has some error ,plz remove it
clc
clear all
k=1
f=2
t=rand(1,1000)
for i=1:100:1
for p=1:100:1
an(i,p)=(sin(2*3.14*(2*k-1)*f*t(i,p)))/(2*k-1);
end
end
plot(t,an)
here
i want to store every value of this function
an(i,p)=(sin(2*3.14*(2*k-1)*f*t(i,p)))/(2*k-1);
so that i can plot it at the end

채택된 답변

Torsten
Torsten 2022년 9월 17일
편집: Torsten 2022년 9월 17일
k=1
f=2
t=rand(100);
an = sin(2*pi*(2*k-1)*f*t)/(2*k-1);

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Loops and Conditional Statements에 대해 자세히 알아보기

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by