AMATH 301 Lecture Notes - Lecture 4: Asteroid Family, Matlab

69 views3 pages
10 Jan 2018
School
Course

Document Summary

%lecture 4 notes clear all; close all; clc x_plot = 2:0. 01:5; %counts from 2 to 5 in increments of . 01 y_plot = sin(x_plot); %to generate a graph of x_plot vs y_plot: plot (x_plot,y_plot); %this turns on a grid in the graph generated: grid on; %this is how to write a code to find the zeros in a given function x. %the parameters of 2 and 5, this code checks the midpoint between these two. %inputs and continues updating the code until it recieves an input. a = 2; %must be at least one zero because 2 is positive output and 5 is negative. %output, so mean value thm applies and we know we have a zero somewhere. %writing code to forsee how to write our for loop: x1 = (a+b) / 2; fx1 = sin(x1); %now we change a because fx1 > 0 a = x2; %set a and b parameters to check within a=-1. 5; b=1;

Get access

Grade+20% off
$8 USD/m$10 USD/m
Billed $96 USD annually
Grade+
Homework Help
Study Guides
Textbook Solutions
Class Notes
Textbook Notes
Booster Class
40 Verified Answers
Class+
$8 USD/m
Billed $96 USD annually
Class+
Homework Help
Study Guides
Textbook Solutions
Class Notes
Textbook Notes
Booster Class
30 Verified Answers

Related textbook solutions

Related Documents