Hey there! Sign in to join this conversationNew here? Join for free
x Turn on thread page Beta

Is there anyone that could help me with Matlab? watch

    • Thread Starter
    Offline

    3
    ReputationRep:
    Are there any Matlab experts out there that could help me with Matlab please?
    Offline

    22
    ReputationRep:
    (Original post by Zenarthra)
    Are there any Matlab experts out there that could help me with Matlab please?
    Do you have a specific query?
    • Thread Starter
    Offline

    3
    ReputationRep:
    (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
    Offline

    22
    ReputationRep:
    (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.
 
 
 
Reply
Submit reply
Turn on thread page Beta
Updated: November 6, 2015
Poll
Do you agree with the proposed ban on plastic straws and cotton buds?
Useful resources

Make your revision easier

Maths

Maths Forum posting guidelines

Not sure where to post? Read the updated guidelines here

Equations

How to use LaTex

Writing equations the easy way

Student revising

Study habits of A* students

Top tips from students who have already aced their exams

Study Planner

Create your own Study Planner

Never miss a deadline again

Polling station sign

Thinking about a maths degree?

Chat with other maths applicants

Can you help? Study help unanswered threads

Groups associated with this forum:

View associated groups

The Student Room, Get Revising and Marked by Teachers are trading names of The Student Room Group Ltd.

Register Number: 04666380 (England and Wales), VAT No. 806 8067 22 Registered Office: International House, Queens Road, Brighton, BN1 3XE

Write a reply...
Reply
Hide
Reputation gems: You get these gems as you gain rep from other members for making good contributions and giving helpful advice.