Why is cos_orbit(0,25) not working?

4 visualizaciones (últimos 30 días)
Kameron Gill
Kameron Gill el 28 de Oct. de 2015
Respondida: Geoff Hayes el 28 de Oct. de 2015
Hello, in my book it said to run cos_orbit(0,25) to get a specific graph. I try to run this code and i get this error
>> cos_orbit(0,25) Attempt to execute SCRIPT cos_orbit as a function: C:\Users\MyNamehere\Documents\MATLAB\cmpe8\hw3\cos_orbit.m
  3 comentarios
Kameron Gill
Kameron Gill el 28 de Oct. de 2015
Task 3.3.3 Let’s use MATLAB to plot some orbits of the model xn+1 = cos xn. Create a MATLAB function and call it ‘cos orbit’. This function will have two inputs, x and N, where x is the initial value, and N is the number of iterations the program will perform. The function should then plot the orbit. For instance, cos orbit(0,25) should generate the left plot in Figure 3.1. Now, join the data points to make your plot look the right plot in Figure 3.1.
that is what the task says
James Tursa
James Tursa el 28 de Oct. de 2015
Please post your cos_orbit.m and then we can advise how to turn your apparent script into a function that can be called with input arguments.

Iniciar sesión para comentar.

Respuesta aceptada

Geoff Hayes
Geoff Hayes el 28 de Oct. de 2015
Kameron - your assignment is telling you to create a function called cos_orbit that has two inputs, x and N. With that in mind, the first line of your cos_orbit.m file should be
function cos_orbit(x,N)

Más respuestas (0)

Categorías

Más información sobre Time Series Objects en Help Center y File Exchange.

Community Treasure Hunt

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

Start Hunting!

Translated by