Convert matrix A to S

1 Ansicht (letzte 30 Tage)
SuzieChan
SuzieChan am 20 Okt. 2019
Kommentiert: Stephan am 20 Okt. 2019
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 Kommentar
Stephan
Stephan am 20 Okt. 2019
Bearbeitet: Stephan am 20 Okt. 2019
Did you notice that you can accept and/or vote for useful answers?

Melden Sie sich an, um zu kommentieren.

Antworten (1)

Stephan
Stephan am 20 Okt. 2019
S=[A(2,1:2); A(1,1:2); 9 10]
  6 Kommentare
SuzieChan
SuzieChan am 20 Okt. 2019
Bearbeitet: SuzieChan am 20 Okt. 2019
I see all numbers in Z except 1 and 5.
So is possible to insert 1 and 5 into new code, S?
Where do I place them?
example..
S=[1 5; Z(1:2); Z(1:2)]
something like
S=[1; Z(1:2); 5; Z(1:2)]
to manually put 1 and 5 in new matrix S
how?
Stephan
Stephan am 20 Okt. 2019
>> S = [1 Z(3,3); 5 Z(2,1); Z(2,2:end)]
S =
1 2
5 8
9 10

Melden Sie sich an, um zu kommentieren.

Kategorien

Mehr zu Data Type Conversion finden Sie in Help Center und File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by