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

How do i create a 30 by 30 matrix, the diagonal elements to be 10, all other elements to be 6 without loops?

4 commentaires

Did you search for it? Have you tried something? Why would we directly give the answer to you? Show us your effort.
Just found the answer myself lol (Eye(30)*6+4). Also @Birdman if you dont have anything valuable to add dont comment. This is QnA not a ethics forum.
This was what I was talking about. Little bit of search through internet would lead you to the answer.

@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.

Connectez-vous pour commenter.

Réponses (0)

Community Treasure Hunt

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

Start Hunting!

Translated by