Filter löschen
Filter löschen

Transpose x from a row vector to a column vector using the transpose operator. The program is prompting the x does not have correct values. the code i have entered is below

1 Ansicht (letzte 30 Tage)
TASK
Transpose x from a row vector to a column vector using the transpose operator.
The code i wrote is the following
x=[1:5;]
x=x'
Test Results:
Incorrect!
Does x have five elements? ok
Is x a column vector? ok
Does x have the correct values? Not correct

Antworten (2)

Alan Stevens
Alan Stevens am 9 Jun. 2021
You probably meant
x = [1:5]; % ie the ; is after the ]
However, it seems to work ok for me as you wrote it!

Hammad Ur Rahman
Hammad Ur Rahman am 23 Jun. 2021
write
x=x'

Kategorien

Mehr zu Get Started with MATLAB 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