Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

why am i receiving error message array indices must be positive integers or logical values for the below code in MATLAB f=@ (t, x, y,

why am i receiving error message "array indices must be positive integers or logical values" for the below code in MATLAB
image

f=@ (t, x, y, z) 10* (y-x); g-@ (t, x, y, z) x* (28-z)-y; h-@ (t, x, y, z) x*y-((8/3) *z); function 3 function 1 function 2 Delta=0.0001; step size t=0: Delta: 50; n= (50-0) /Delta; number of points Initial conditons x (0)=0; y (0)=1; z (0)=0; Rk4 for system for i=1:n Kl Delta* f (t(i),x(i),y(i), z(i)); Ll=Delta*g (t(i),x(i),y(i),z (1));| Ml Delta *h (t(i),x(i),y(i), z (i)); K2 Delta f (t (1) +Delta/2,x(i) +K1/2, y(i) +L1/2, z (i) +M1/2); L2-Delta*g (t (i) +Delta/2,x(i) +K1/2, y(i) +L1/2, z (i) +M1/2); M2 Delta h (t (i) +Delta/2,x(i) +K1/2,y(i) +L1/2, z (1) +M1/2); K3 Delta* f (t (i) +Delta/2,x(i) +K2/2, y(i)+L2/2) ;z (1) +M2/2; L3 Delta*g (t (1) +Delta/2, x (1) +K2/2, y (1) +12/2, z (1) +M2/2); M3-Delta*h (t (1) +Delta/2,x(i) +K2/2,y (1)+L2/2, z (1) +M2/2): K4 Delta f (t (i) +Delta,x(i) +K3, y (1) +L3, z (1) +M3); L4-Delta g (t (1) +Delta,x (1) +K3, y (1)+L3, z (1) +M3) ; M4 Delta h (t (1) +Delta, x (1) +K3, y (1) +L3, z (1) +M3) ; x (1+1)=x (1) + (1/6) (K1+2 K2+2 K3+K4); y (1+1) -y (1) + (1/6)* (L1+2 12+2*13+14); z (1+1)=z (1) + (1/6) (M1-2 M2+2 M3+M4); end plot (x, y, z, '=');

Step by Step Solution

3.39 Rating (174 Votes )

There are 3 Steps involved in it

Step: 1

The code you provided seems to contain several syntax errors and inconsistencies Heres the modified ... blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Income Tax Fundamentals 2013

Authors: Gerald E. Whittenburg, Martha Altus Buller, Steven L Gill

31st Edition

1111972516, 978-1285586618, 1285586611, 978-1285613109, 978-1111972516

More Books

Students also viewed these Programming questions