フィルターのクリア

Info

この質問は閉じられています。 編集または回答するには再度開いてください。

Index exceeds the number of array elements (1)

1 回表示 (過去 30 日間)
Omar Khammash
Omar Khammash 2020 年 4 月 17 日
閉鎖済み: MATLAB Answer Bot 2021 年 8 月 20 日
clear all; close all; clc;
for A=1,i=1:10;
x(1+i)=(4-0.1*z(i+1)-4*sqrt(y(i+1)))/3;
y(1+i)=(16+log10(z(i))-x(i)*sin(x(i)))/12;
z(1+i)=(9+A*exp(y(i)*y(i))-1/(x(i)+10))/1;
fprintf('x= %f,\ty= %f,\tz= %f\n',x(i),y(i),z(i));
end
Not sure how to fix this. help please.
  1 件のコメント
Subhamoy Saha
Subhamoy Saha 2020 年 4 月 17 日
what are the sizes of y and z array?

回答 (1 件)

madhan ravi
madhan ravi 2020 年 4 月 17 日
x=1;
x(2) % errors because it has only element
  1 件のコメント
Omar Khammash
Omar Khammash 2020 年 4 月 17 日
sorry, i forgot to to add this line after line (1) when i asked the question
x(1)=0; y(1)=0; z(1)=0;
if you put that line between the clear statement and the for loop, that is how my code exactly looks like.
how can i fix that error?

この質問は閉じられています。

タグ

Community Treasure Hunt

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

Start Hunting!

Translated by