Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7437333
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 29, 20262026-05-29T10:22:59+00:00 2026-05-29T10:22:59+00:00

suppose i have A=ones(10,1)*10 then what does this do eye(10)(A,:) ?? i know eye

  • 0

suppose i have A=ones(10,1)*10
then what does this do eye(10)(A,:) ??

i know eye gives a 10,10 identity matrix but i am not really sure what the above code is doing.
and what is the equivalent code in Matlab?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-29T10:23:00+00:00Added an answer on May 29, 2026 at 10:23 am

    A=ones(10,1)*10 just makes a column matrix (10 rows, 1 column) of 10s.

    eye(10) makes a 10×10 identity matrix.

    The (A,:) indexes into the identity matrix you just made. The A here acts as a numeric index into the eye(10) matrix. Suppose A was just 10. Then the myMatrix(A,:) would select the 10th row of myMatrix. Since A is 10 rows of 10, myMatrix(A,:) selects the 10th row of myMatrix, 10 times. So you get back out the 10th row of eye(10) 10 times.

    It may be less confusing if you do A=ones(5,1)*10 and have a look at eye(10)(A,:); notice that you now only get the 10th row of A 5 times.

    You can’t do this as such in Matlab because it doesn’t let you do the one-hit eye(10)(A,:). You have to do it in two steps:

    A = ones(10,1)*10
    I = eye(10)
    I(A,:)
    

    More on various types of matrix indexing in Matlab.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm not sure if this is the right approach but I have a datagridview
Suppose I have a stringbuilder in C# that does this: StringBuilder sb = new
Suppose I have a c++ array of bits, ones and zeros, and I want
Many similar posts but this is not a duplicate I believe. When I add
I'm trying to use this gem to create a honeypot field, but I'm not
Let's suppose I have an interface named Controller. Several classes implement this interface and
Suppose I have a matrix such that each row is a standard basis vector,
Suppose you have 2 different ASP.NET applications in IIS. Also, you have some ASCX
Suppose we have a table A: itemid mark 1 5 2 3 and table
Suppose I have the following CSS rule in my page: body { font-family: Calibri,

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.