- #1
twotaileddemon
- 260
- 0
Hi, I'm new to MATLAB and I have a problem:
I am trying to create a multiplication matrix of sorts.
The first row will have numbers from 0 to 1 in steps of .0101
The first column will have the same, from 0 to 1 in steps of .0101
Then to generate the rest I will multiple each entry in the column by their corresponding row.
For example, the 2nd column, 2nd row entry will be .0101 * .0101
It will look like this:
0 .0101 .0202 ... 1
.0101 (.0101 * .0101) (.0101 * .0202) ... 1
.
.
.
1 ( 1 * .0101) (1 * .0202) ... 1
The problem is, I don't know how to write a code to do this. I'm sure it involves a loop of some sort with indexing from 1 to 100. Can someone help me?
I thought this might help somewhere:
indexfinal=99;
0:1/indexfinal:1;
Indeed, it gives me the steps of .0101 I'm looking for.
I just don't know how to make it so that I can create a matrix like the aboveformentioned.
I am trying to create a multiplication matrix of sorts.
The first row will have numbers from 0 to 1 in steps of .0101
The first column will have the same, from 0 to 1 in steps of .0101
Then to generate the rest I will multiple each entry in the column by their corresponding row.
For example, the 2nd column, 2nd row entry will be .0101 * .0101
It will look like this:
0 .0101 .0202 ... 1
.0101 (.0101 * .0101) (.0101 * .0202) ... 1
.
.
.
1 ( 1 * .0101) (1 * .0202) ... 1
The problem is, I don't know how to write a code to do this. I'm sure it involves a loop of some sort with indexing from 1 to 100. Can someone help me?
I thought this might help somewhere:
indexfinal=99;
0:1/indexfinal:1;
Indeed, it gives me the steps of .0101 I'm looking for.
I just don't know how to make it so that I can create a matrix like the aboveformentioned.
Last edited: