why am i receiving error message array indices must be positive integers or logical values for the
Fantastic news! We've Found the answer you've been seeking!
Question:
why am i receiving error message "array indices must be positive integers or logical values" for the below code in MATLAB
Transcribed Image Text:
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, '='); 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, '=');
Expert Answer:
Answer rating: 100% (QA)
The code you provided seems to contain several syntax errors and inconsistencies Heres the modified ... View the full answer
Related Book For
Income Tax Fundamentals 2013
ISBN: 9781285586618
31st Edition
Authors: Gerald E. Whittenburg, Martha Altus Buller, Steven L Gill
Posted Date:
Students also viewed these programming questions
-
Why should a writer avoid the opening I am sending this e-mail because we have just hired a new manager, and I would like to introduce her?
-
For any positive integer n, the MATLAB command P = pascal(n) will generate an n à n matrix P whose entries are given by The name pascal refers to Pascal's triangle, a triangular array of...
-
In computing depreciation, three values must be known or estimated; identify and explain the nature of each.
-
Calculate the following limits at infinity. If necessary, use -inf and inf to denote -co and co. Use DNE if a limit does not exist. 1. lim e = 818 2. lim e = 8178 3. lim In(x) 24x In(x) =
-
What is a father-son-grandson relationship?
-
If market participants expect the krona to appreciate relative to the dollar, what will happen?
-
Use the financial data for Randa Merchandising, Inc., in Exercise 13-13 to prepare its income statement for calendar-year 2017. (Ignore the earnings per share section.) Data From Exercise 13.13 In...
-
Wingman Distributing Company is expanding its supply chain to include a new distribution hub In South Bend. A key decision involves the number of trucks for the facility. The particular model of...
-
A 120-room building has 14 1-bedroom units renting monthly at $150.00. 12 2-bedroom units at $200.00, and 8 3-bedroom units at $250.00. The gross annual rental would be?
-
The Country Store is a retail outlet for a variety of hardware and housewares. The owner is eager to prepare a budget and is especially concerned with her cash position. The company will have to...
-
1.) Is sea power/sea control important for a country? Explain your answer and sight instances on how sea control benefits a country. How can we (Filipinos) as a Nation change our attitude and mindset...
-
What substantive procedures are normally performed over property, plant, and equipment additions?
-
What are three possible tests of controls over the operating effectiveness of cash receipts?
-
List the six steps involved in the payroll cycle.
-
List four inherent risks over the sales and receivable cycle.
-
Explain the purpose of a capital asset sub-ledger.
-
The salesman has told you that for only $320 a month and no money down you can own a Mustang. The loan has an annual interest rate of 6.2% compounded monthly and is payable over the next 4.5 years....
-
Prove the following D,(cos x) = - sin x (Hint: Apply the identity cos(A + B) = cos A cos B sin A sin B)
-
Carol Harris, Ph.D, CPA, is a single taxpayer and she lives at 674 Yankee Street, Durham, NC 27409. Her Social Security number is 793-52-4335. Carol is an Associate Professor of Accounting at a local...
-
Lisa Sizemore, a taxpayer in the 10-15 percent tax bracket, purchased stock as an investment on July 11, 2011. She sold the stock on July 9, 2012, 2 days before qualifying for the long-term holding...
-
Cedar Corporation has an S corporation election in effect. During the 2012 calendar tax year, the corporation had ordinary taxable income of $200,000, and on January 15, 2012, the corporation paid...
-
Macquarie Manufacturing Ltd prepared the following planned production data for the forthcoming year ending 30 June 2019. Required (a) Prepare a table showing the predetermined factory overhead rate...
-
Beautiful Bottles Pty Ltd, bottle manufacturer for the food industry, has just installed a job order costing system. The company uses machine hours to apply its overhead to work in process. On 1 May...
-
Green Consultants Pty Ltd specialise in consulting on landscape design. The company developed a predetermined charge-out rate based on hours for each of its consultants on 1 July 2019 to assign the...
Study smarter with the SolutionInn App