How do I write an inductive sequence?

7 次查看(过去 30 天)
I need to put in the sequence x(subscriptn)=4x(subscript n-1)[1-x(subscript n-1)]. I have x0.
  2 个评论
John D'Errico
John D'Errico 2020-4-12
I would point out that everything you need to know about something basic like this is already explained in depth, in the getting started tutorials.
In there, you will learn what a vector is. How to index a vector. How to write a loop.
I know. Reading the manual is boring. They put all that useful information in there, and you are in a hurry, so we need to re-write the manual for you, one part at a time.
Rebecca Hollister
Rebecca Hollister 2020-4-12
I would point out that I spent three hours looking through the manual before typing this question. Clearly I was looking in the wrong place as I have never used this program before, or any computer programs. I didn't know this terminology was "vector" and "loop" as we use other terms in my math class. If anyone could point me to the right section of the manual, I would be happy to read as much information on it as possible.
It's too bad there isn't a manual for kindness and compassion. But thanks for your disheartening message, I guess.

请先登录,再进行评论。

采纳的回答

Torsten
Torsten 2020-4-12
N = 10; % define number of recurrence terms to be calculated
x = zeros(N,1);
x(1) = 3; % define x0
for n = 2:N
x(n) = 4*x(n-1) * (1 - x(n-1)); %calculate the xi
end
x
  1 个评论
Rebecca Hollister
Rebecca Hollister 2020-4-12
Thank you SO SO much. You are truly a gem. I hope you have a fantastic day.

请先登录,再进行评论。

更多回答(0 个)

类别

Help CenterFile Exchange 中查找有关 MATLAB 的更多信息

产品

Community Treasure Hunt

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

Start Hunting!

Translated by