3x3 Matrix - always Error "unexpected impression"

16 Ansichten (letzte 30 Tage)
Leonie Wollscheid
Leonie Wollscheid am 29 Okt. 2017
Bearbeitet: KL am 29 Okt. 2017
I tried so much but it doesn´t work anymore. I´ve learned to create in matlab a 3x3 matrix the following term: matrix(1 2 3; 4 5 6; 7 8 9) . The following sentences are my tries in different versions. Thanks for your help!:)
>> matrix(1 -1 4; 3 4 5; 5 6 5) matrix(1 -1 4; 3 4 5; 5 6 5) ↑ Error: Unexpected MATLAB expression.
>> matrix( 1 -2 4. 3 4 5. 3 4 5) matrix( 1 -2 4. 3 4 5. 3 4 5) ↑ Error: Unexpected MATLAB expression.
>> matrix(1 -1 4 ;3 4 5 ; 3 4 5) matrix(1 -1 4 ;3 4 5 ; 3 4 5) ↑ Error: Unexpected MATLAB expression.
>> matrix(1 -1 5 ;3 4 5 ; 3 4 5) matrix(1 -1 5 ;3 4 5 ; 3 4 5) ↑ Error: Unexpected MATLAB expression.
>> matrix[1 -1 4; 3 -2 0; 3 3 3] matrix[1 -1 4; 3 -2 0; 3 3 3] ↑ Error: Unbalanced or unexpected parenthesis or bracket.
>> matrix(1 -1 4; 3 -2 0; 3 3 3) matrix(1 -1 4; 3 -2 0; 3 3 3) ↑ Error: Unexpected MATLAB expression.
>> matrix(1 -1 4 ; 3 -2 0 ; 3 3 3) matrix(1 -1 4 ; 3 -2 0 ; 3 3 3) ↑ Error: Unexpected MATLAB expression.
>> matrix(1 2 3; 4 5 6; 7 8 9) matrix(1 2 3; 4 5 6; 7 8 9) ↑ Error: Unexpected MATLAB expression.
>> w=(1 -1 4;3 -2 0;3 3 3) w=(1 -1 4;3 -2 0;3 3 3) ↑ Error: Unexpected MATLAB expression.
>> matrix(1 3 3; 4 5 6; 7 8 9) matrix(1 3 3; 4 5 6; 7 8 9) ↑ Error: Unexpected MATLAB expression.
>> w[1 -1 4; 3 -2 0; 3 3 3] w[1 -1 4; 3 -2 0; 3 3 3] ↑ Error: Unbalanced or unexpected parenthesis or bracket.
>>

Antworten (1)

KL
KL am 29 Okt. 2017
Bearbeitet: KL am 29 Okt. 2017
You use []
matrix_A = [1 2 3; 4 5 6; 7 8 9];
Instead of blindly trying random things, spend few minutes to read the documentation,

Kategorien

Mehr zu Creating and Concatenating Matrices 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