Path: news.mathworks.com!not-for-mail
From: <HIDDEN>
Newsgroups: comp.soft-sys.matlab
Subject: Re: Does anyone know how to do any of these programs?
Date: Sat, 29 Nov 2008 19:56:01 +0000 (UTC)
Organization: The MathWorks, Inc.
Lines: 31
Message-ID: <ggs6oh$hrq$1@fred.mathworks.com>
References: <8659463.1227927779634.JavaMail.jakarta@nitrogen.mathforum.org> <ggqdus$bu7$1@fred.mathworks.com>
Reply-To: <HIDDEN>
NNTP-Posting-Host: webapp-02-blr.mathworks.com
Content-Type: text/plain; charset="ISO-8859-1"
Content-Transfer-Encoding: 8bit
X-Trace: fred.mathworks.com 1227988561 18298 172.30.248.37 (29 Nov 2008 19:56:01 GMT)
X-Complaints-To: news@mathworks.com
NNTP-Posting-Date: Sat, 29 Nov 2008 19:56:01 +0000 (UTC)
X-Newsreader: MATLAB Central Newsreader 1621609
Xref: news.mathworks.com comp.soft-sys.matlab:503823


"Roger Stafford" <ellieandrogerxyzzy@mindspring.com.invalid> wrote in message <ggqdus$bu7$1@fred.mathworks.com>...
> a999 <alikohbodi@yahoo.com> wrote in message <8659463.1227927779634.JavaMail.jakarta@nitrogen.mathforum.org>...
> > Does anyone know how to do any of these programs? help will be much appreciated. 
> > ..........
> 
>   If you have any particular feature of one of these problems that involves some Matlab coding techniques, you might be able to persuade someone in this group to help you with it, but surely not unless you have already made significant progress on it yourself.  We are not in the business of doing general homework assignments, but only that of answering certain specific questions concerned with the use of Matlab.
> 
> Roger Stafford

Ok, thank you for informing me, that is no problem. I am new to matlab and a lot of the simple things that i want to do get me stuck, and i get frustrated since then it doesnt even matter if i know what to do, I cant do it cause i am not familiar with the process and the language. 
For the first problem: Implement the bisection method in a computer code, and compute the roots of the quadratic equation
x2 &#8722; 2 x + 0.9 = 0. Prepare and discuss a graph of the error against the iteration count, k.

I have written the following the code:
clc; clear all; close all;
y(x)=(x^2)-(2*x)+(0.9);
X1=2;
X2=-2;
Xm=(0.5)*(y(X1)+y(X2));
d=X2-X1;
Xnewm=Xm+(0.5*d);
disp(Xnewm);

result:
??? Undefined function or variable 'x'.

Error in ==> hw5p1 at 2
y(x)=(x^2)-(2*x)+(0.9);

this is probably a stupid question but how do i plug in X1 and X2 into the y(x) equation, what format do i have to use for that? 
thanks you