필터 지우기
필터 지우기

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