30 by 30 matrix. Diagonal elements = 10. Everything else= 6.

3 views (last 30 days)
How do i create a 30 by 30 matrix, the diagonal elements to be 10, all other elements to be 6 without loops?
  4 Comments
Birdman
Birdman on 25 Jan 2021
This was what I was talking about. Little bit of search through internet would lead you to the answer.
Walter Roberson
Walter Roberson on 25 Jan 2021

@Vatsal Rajyaguru

This is not a service to exploit volunteers. It is MATLAB users helping other MATLAB users to learn. We have long experience that the best way to teach people is not to just give them the answers, but to instead to guide them through learning. And as part of guiding through learning it is entirely fair to ask what the person has already accomplished -- and it is entirely proper for the volunteers to use ethics in deciding what assistance to give.
The volunteers are not here to just "put out or shut up". We are going to ask for effort to have been demonstrated. If that is not to your liking, you are not required to post here.

Sign in to comment.

Answers (0)

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!