Results 1 to 6 of 6

Math Help - Question in matlab

  1. #1
    Member
    Joined
    Sep 2009
    Posts
    161

    Question in matlab

    Hi All
    I want to ask question on matlab
    if we write the following statement in M-file

    for i=1:10
    for j=1:10
    a(i,j)=input('a(i,j)=')
    end
    end
    so the program print the following
    a(i,j)=
    a(i,j)=
    .
    .
    .
    .a(i,j)
    now the question How can create a program print the following
    a(1,1)
    a(1,2)
    ..
    .
    .
    .
    a(10,10)

    Best regard
    Follow Math Help Forum on Facebook and Google+

  2. #2
    MHF Contributor alexmahone's Avatar
    Joined
    Oct 2008
    Posts
    1,074
    Thanks
    7
    Quote Originally Posted by raed View Post
    Hi All
    I want to ask question on matlab
    if we write the following statement in M-file

    for i=1:10
    for j=1:10
    a(i,j)=input('a(i,j)=')
    end
    end
    so the program print the following
    a(i,j)=
    a(i,j)=
    .
    .
    .
    .a(i,j)
    now the question How can create a program print the following
    a(1,1)
    a(1,2)
    ..
    .
    .
    .
    a(10,10)

    Best regard
    Code:
    for i=1:10
      for j=1:10
        a(i,j)
      end
    end
    Follow Math Help Forum on Facebook and Google+

  3. #3
    Member
    Joined
    Sep 2009
    Posts
    161
    Quote Originally Posted by alexmahone View Post
    Code:
    for i=1:10
      for j=1:10
        a(i,j)
      end
    end
    no, it is not walk .moreover, I must inter the value of a(i,j)
    Follow Math Help Forum on Facebook and Google+

  4. #4
    Grand Panjandrum
    Joined
    Nov 2005
    From
    someplace
    Posts
    14,972
    Thanks
    4
    Quote Originally Posted by raed View Post
    no, it is not walk .moreover, I must inter the value of a(i,j)

    ss=[ 's(' , num2str(i) , num2str(j), ')' ];disp(ss);

    CB
    Follow Math Help Forum on Facebook and Google+

  5. #5
    Member
    Joined
    Sep 2009
    Posts
    161
    Quote Originally Posted by CaptainBlack View Post
    ss=[ 's(' , num2str(i) , num2str(j), ')' ];disp(ss);

    CB
    But this is print the following
    a(11)
    a(12)
    .
    .
    .
    .
    a(1010)

    it is good but can we print as the following:
    a(1,1)
    a(1,2)
    .
    .
    a(10,10)


    thank you?
    Follow Math Help Forum on Facebook and Google+

  6. #6
    Grand Panjandrum
    Joined
    Nov 2005
    From
    someplace
    Posts
    14,972
    Thanks
    4
    Quote Originally Posted by raed View Post
    But this is print the following
    a(11)
    a(12)
    .
    .
    .
    .
    a(1010)

    it is good but can we print as the following:
    a(1,1)
    a(1,2)
    .
    .
    a(10,10)


    thank you?
    Look at the code, see what it does and why, then make the change that is needed to achieve the effect that you want.

    It summarise, you have enough information to do what you want if you make the least bit of effort to understand what you have been shown.

    CB
    Follow Math Help Forum on Facebook and Google+

Similar Math Help Forum Discussions

  1. Question in matlab
    Posted in the Math Software Forum
    Replies: 2
    Last Post: December 24th 2010, 11:32 AM
  2. matlab question.need help :(
    Posted in the Math Software Forum
    Replies: 0
    Last Post: October 7th 2009, 06:58 AM
  3. Matlab Question Help
    Posted in the Math Software Forum
    Replies: 6
    Last Post: September 20th 2009, 09:57 PM
  4. A Matlab Question
    Posted in the Math Software Forum
    Replies: 2
    Last Post: August 8th 2009, 12:02 AM
  5. Hello - Matlab question
    Posted in the Math Software Forum
    Replies: 1
    Last Post: May 3rd 2009, 10:59 PM

Search Tags


/mathhelpforum @mathhelpforum