Wonder
Wonder

Reputation: 123

What does x=[-300:1.1:300]'; mean?

In the code :

x=[-300:1.1:300]'; 

I don't understand what the single quote is for. What does this entire line mean?

I thought this syntax meant, x takes values from -300 to 300, with steps of 1.1.

A fragment of my code is:

x=[-300:1.1:300]';  
y=x;  
[X,Y]=meshgrid(x,y);  

I am plotting a graph here.

Upvotes: 1

Views: 48

Answers (1)

Suhas C
Suhas C

Reputation: 192

Your understanding is correct. The single quote is for transpose. It changes x from a row vector to a column vector. Probably meshgrid wants columns, not rows.

Upvotes: 1

Related Questions