i want create this matrix

i want create this matrix in one ligne command and use (ones,eye...)
m =
1.0000 3.1416 3.0000 4.0000 0 0 5.0000
1.0000 0 3.1416 4.0000 0 0 6.0000
1.0000 0 0 3.1416 0 0 7.0000
1.0000 0 0 0 3.1416 0 8.0000
1.0000 0 0 0 0 3.1416 9.0000

댓글 수: 3

Guillaume
Guillaume 2019년 11월 27일
I'm sure it's possible to create a cryptic and unreadable one-liner to create this matrix, but why do you need that?
adem ski
adem ski 2019년 11월 27일
i want this matrix for start make program
can you help me!
Guillaume
Guillaume 2019년 11월 27일
Just write the matrix in your code as you've written it above. It'll be so much more readable that any one-liner and instantly clear what the matrix is.
Case in point, I'll challenge anyone reading Jesus' one liner to say what matrix it generates immediately upon reading the code.

답변 (1개)

JESUS DAVID ARIZA ROYETH
JESUS DAVID ARIZA ROYETH 2019년 11월 27일

0 개 추천

solution :
m=[ones(5,1) pi*eye(5) (5:9)']+[diag(4,3)+diag(3:4,2) zeros(4,3 ); zeros(1,7)]

이 질문은 마감되었습니다.

태그

아직 태그를 입력하지 않았습니다.

질문:

2019년 11월 27일

마감:

2021년 8월 20일

Community Treasure Hunt

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

Start Hunting!

Translated by