Create a column vector with elements counting down from 200 to 0 in increments of 5

I created the vector, C= [200:-5:0] and I git an error that reads, Variable C must have size[41 1]. It is currently of size [1 41]

1 Kommentar

Note that the square brackets are completely superfluous. The MATLAB approach is simply:
C= 200:-5:0;

Melden Sie sich an, um zu kommentieren.

Antworten (1)

Try transposing your output to flip it from a row vector (list of numbers going horizontally) to a column (list of numbers going vertically) like this:
C = C'

Kategorien

Mehr zu Simulink finden Sie in Hilfe-Center und File Exchange

Gefragt:

am 1 Aug. 2022

Kommentiert:

am 2 Aug. 2023

Community Treasure Hunt

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

Start Hunting!

Translated by