Path: news.mathworks.com!not-for-mail
From: <HIDDEN>
Newsgroups: comp.soft-sys.matlab
Subject: Programming Question
Date: Sun, 21 Jun 2009 19:54:02 +0000 (UTC)
Organization: The MathWorks, Inc.
Lines: 18
Message-ID: <h1m34q$fod$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 1245614042 16141 172.30.248.37 (21 Jun 2009 19:54:02 GMT)
X-Complaints-To: news@mathworks.com
NNTP-Posting-Date: Sun, 21 Jun 2009 19:54:02 +0000 (UTC)
X-Newsreader: MATLAB Central Newsreader 1847055
Xref: news.mathworks.com comp.soft-sys.matlab:549333


Hello, I am having issues with inputing this equation into matlab.

basic equation:
M=q^n * ((1-q)/(q))^d

q and n are both inputs from the user

d is a hamming distance that is calculated based on a length

the length is the input n (the length is the number of points on the line)

depending on the length, each point can have a 1 or 0 entry

i.e. if n is 2, the length is 2, and each of the two points can have a 1 or 0 entry, therefore there are 4 different arrangements in a length of 2 units

d is the hamming distance between each of these possible arrangements

this may seem confusing, but any help would be greatly appreciated, i can clarify any questions that may be asked.