Convert matrix A to S
이전 댓글 표시
Hello,
I try to convert ths matrix (called A)
A = [5 8 3; 1 2 3; 2 4 6]
to a matrix called S, using this code
S =
1 2
5 8
9 10
S=[A(1,1:2); A(2:3,1).'; 9 10]
This is not qute right
Any ideas? Thank you
댓글 수: 1
답변 (1개)
Stephan
2019년 10월 20일
S=[A(2,1:2); A(1,1:2); 9 10]
댓글 수: 6
Stephan
2019년 10월 20일
- Please dont accidently delete your questions by editing them ;-) - use the comment function please.
- Also please accept useful answers.
regarding your problem:
In the middle section you look at matrix B not Z:
S=[Z(3, 1:2); B(1:2); 9 10]
Perhaps it would be easier to help if you tell us more background of your problem - the conversion you are trying to do dont give much sense for me at the moment. What is the reason and the background? Please clarify.
SuzieChan
2019년 10월 20일
Stephan
2019년 10월 20일
What are the rules for converting?
Z =
7 6 8
8 9 10
7 3 2
3 0 2
S =
1 2
5 8
9 10
There is no pattern visible - at least for me. I dont see a 1, i dont see a 5 - so how are the rules? PLEASE give us some background information....
Stephan
2019년 10월 20일
>> S = [1 Z(3,3); 5 Z(2,1); Z(2,2:end)]
S =
1 2
5 8
9 10
카테고리
도움말 센터 및 File Exchange에서 Matrix Indexing에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!