Not enough input arguments!

Hi! I am so new to matlab and could really use some help.
I have two separate files. I am getting a "not enough input error" for my for loop and am not sure why. Thanks
from first file:
x0 = 0.7;
iters = 30;
r = 2.5;
x = logistic_map(x0,r,iters);
x1 = x;
r = 3.2;
x = logistic_map(x0,r,iters);
x2 = x;
r = 3.52;
x = logistic_map(x0,r,iters);
x3 = x;
r = 4;
x = logistic_map(x0,r,iters);
x4 = x;
From the second file:
function x = logistic_map(x0,r,iters)
row_num = 1;
for i = 1:iters
x(1,:) = x0;
row_num = row_num + 1;
x_new = r*x0*(1 - x0);
x0 = x_new;
x(row_num,:) = x_new;
end
I am getting an error for the second file
Not enough input arguments.
Error in logistic_map (line 11)
for i = 1:iters
Thank you!

3 件のコメント

Birdman
Birdman 2017 年 11 月 29 日
It says line 11 but there are 10 lines of code in your function. Where is the rest?
yoshiko rhodes
yoshiko rhodes 2017 年 11 月 29 日
oh sorry, they were comments I deleted. line 11 is actually line 3
Star Strider
Star Strider 2017 年 11 月 29 日
Your entire code runs for me without error.

サインインしてコメントする。

回答 (0 件)

カテゴリ

ヘルプ センター および File ExchangeProgramming についてさらに検索

タグ

質問済み:

2017 年 11 月 29 日

コメント済み:

2017 年 11 月 29 日

Community Treasure Hunt

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

Start Hunting!

Translated by