I have a very simple loop that gives out values for d. How would I make it so that these values are saved to a 1 by n matrix?
c=6.25;
x=2.5;
>> for loop = 1:25
d=c-(c^-2+x*c)
c=d;
end

답변 (1개)

Voss
Voss 2021년 11월 30일

0 개 추천

d = zeros(1,25);
c = 6.25;
x = 2.5;
for loop = 1:25
d(loop) = c-(c^-2+x*c);
c = d(loop);
end

카테고리

도움말 센터 및 File Exchange에서 Loops and Conditional Statements에 대해 자세히 알아보기

질문:

2021년 11월 30일

답변:

2021년 11월 30일

Community Treasure Hunt

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

Start Hunting!

Translated by