x Turn on thread page Beta
 You are Here: Home >< Maths

# Is there anyone that could help me with Matlab? watch

1. Are there any Matlab experts out there that could help me with Matlab please?
2. (Original post by Zenarthra)
Are there any Matlab experts out there that could help me with Matlab please?
Do you have a specific query?
3. (Original post by Zacken)
Do you have a specific query?

A = zeros(5,100);
for m = 1:5
for n = 1:100
A(m, n) = 1/(m + n - 1);
end
end

For this code, what is the purpose for defining the vector A 5 by 100 matrix.
When m reaches 5, does the first loop stop?
So do we continue to enter m=5 in the calculation while increasing with n up until 100?
What does A(m,n) mean? why not B = 1/(m+n-1)

Thanks
4. (Original post by Zenarthra)
A = zeros(5,100);
for m = 1:5
for n = 1:100
A(m, n) = 1/(m + n - 1);
end
end

For this code, what is the purpose for defining the vector A 5 by 100 matrix.
When m reaches 5, does the first loop stop?
So do we continue to enter m=5 in the calculation while increasing with n up until 100?
What does A(m,n) mean? why not B = 1/(m+n-1)

Thanks
Playing around with this might be of some help.

When m=5 then we keep m=5 constant and continue the loop for n. So what you said was correct, yes.

A(m,n) means that A depends on m and n - you can't do B = something because you haven't defined B before.

TSR Support Team

We have a brilliant team of more than 60 Support Team members looking after discussions on The Student Room, helping to make it a fun, safe and useful place to hang out.

This forum is supported by:
Updated: November 6, 2015
Today on TSR

### How much will your degree earn you?

Find out where yours ranks...

Poll
Useful resources

### Maths Forum posting guidelines

Not sure where to post? Read the updated guidelines here

### How to use LaTex

Writing equations the easy way

### Study habits of A* students

Top tips from students who have already aced their exams