What is the meaning of the symbol (') at the end of linspace?

7 views (last 30 days)
Hello everyone,
I just started learning MATLAB. I was reading the documentation to plot discrete sequences: https://au.mathworks.com/help/matlab/ref/stem.html
I tried these lines of code online:
figure
X = linspace(0,2*pi,50)';
Y = [cos(X), 0.5*sin(X)];
stem(X,Y)
What is the meaning of the symbol (') in the linspace command before (;)? I can't find documentation about it. I noticed that if I remove it I get the error: X must be same length as Y.
Any help will be appreciate it. Thanks.

Accepted Answer

Juan Carlos Ponce Campuzano
I just figured it out.
This is a row vector:
linspace(0, 2*pi, 50);
This is a colum vector:
linspace(0, 2*pi, 50)';
:)
  2 Comments

Sign in to comment.

More Answers (0)

Categories

Find more on Creating and Concatenating Matrices in Help Center and File Exchange

Community Treasure Hunt

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

Start Hunting!