http://www.mathworks.com/matlabcentral/newsreader/view_thread/254278
MATLAB Central Newsreader  Programming Question
Feed for thread: Programming Question
enus
©19942015 by MathWorks, Inc.
webmaster@mathworks.com
MATLAB Central Newsreader
http://blogs.law.harvard.edu/tech/rss
60
MathWorks
http://www.mathworks.com/images/membrane_icon.gif

Sun, 21 Jun 2009 19:54:02 +0000
Programming Question
http://www.mathworks.com/matlabcentral/newsreader/view_thread/254278#659165
Rafael
Hello, I am having issues with inputing this equation into matlab.<br>
<br>
basic equation:<br>
M=q^n * ((1q)/(q))^d<br>
<br>
q and n are both inputs from the user<br>
<br>
d is a hamming distance that is calculated based on a length<br>
<br>
the length is the input n (the length is the number of points on the line)<br>
<br>
depending on the length, each point can have a 1 or 0 entry<br>
<br>
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<br>
<br>
d is the hamming distance between each of these possible arrangements<br>
<br>
this may seem confusing, but any help would be greatly appreciated, i can clarify any questions that may be asked.

Sun, 21 Jun 2009 20:34:01 +0000
Re: Programming Question
http://www.mathworks.com/matlabcentral/newsreader/view_thread/254278#659170
Rafael
In order to clarify this, I have scanned an example worked out on pen and paper:<br>
<br>
<a href="http://img526.imageshack.us/img526/5264/mutation.jpg">http://img526.imageshack.us/img526/5264/mutation.jpg</a><br>
<br>
Thanks again

Sun, 21 Jun 2009 20:47:01 +0000
Re: Programming Question
http://www.mathworks.com/matlabcentral/newsreader/view_thread/254278#659174
Sadik
You seem to have figured out. I am writing the equations in case you haven't:<br>
<br>
q = 0.4;<br>
n = 2;<br>
d = [0 1 1 2;1 0 2 1;1 2 0 1;2 1 1 0];<br>
M=q^n * ((1q)/(q))^d;<br>
<br>
Best.<br>
<br>
"Rafael " <rrodriguez1989@gmail.com> wrote in message <h1m34q$fod$1@fred.mathworks.com>...<br>
> Hello, I am having issues with inputing this equation into matlab.<br>
> <br>
> basic equation:<br>
> M=q^n * ((1q)/(q))^d<br>
> <br>
> q and n are both inputs from the user<br>
> <br>
> d is a hamming distance that is calculated based on a length<br>
> <br>
> the length is the input n (the length is the number of points on the line)<br>
> <br>
> depending on the length, each point can have a 1 or 0 entry<br>
> <br>
> 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<br>
> <br>
> d is the hamming distance between each of these possible arrangements<br>
> <br>
> this may seem confusing, but any help would be greatly appreciated, i can clarify any questions that may be asked.

Sun, 21 Jun 2009 20:50:02 +0000
Re: Programming Question
http://www.mathworks.com/matlabcentral/newsreader/view_thread/254278#659176
us
"Rafael " <rrodriguez1989@gmail.com> wrote in message <h1m5fp$d49$1@fred.mathworks.com>...<br>
> In order to clarify this, I have scanned an example worked out on pen and paper:<br>
> <br>
> <a href="http://img526.imageshack.us/img526/5264/mutation.jpg">http://img526.imageshack.us/img526/5264/mutation.jpg</a><br>
> <br>
> Thanks again<br>
<br>
thanks for the example...<br>
now, where is your ML code...<br>
<br>
us

Sun, 21 Jun 2009 20:52:01 +0000
Re: Programming Question
http://www.mathworks.com/matlabcentral/newsreader/view_thread/254278#659177
Rafael
Thank you for your response!<br>
<br>
I am trying to figure out how to write a simple program that will take an input of "n" and display a resulting matrix based on the work that I scanned in.<br>
<br>
Thanks!