help-octave
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: apostrophe after linspace code


From: Bill Denney
Subject: Re: apostrophe after linspace code
Date: Thu, 12 Jun 2008 23:21:07 -0400
User-agent: Thunderbird 2.0.0.14 (Windows/20080421)

Siddhartha wrote:
can anyone tell me the significance of having the apostrophe
' after a line of code?

something like this:

x = linspace(0,100,100)';

What is the difference between having that and leaving it
out? I can't tell, so any help would be great!

Hi Siddhartha,

The apostrophe is the transpose operator. What it does in the above line is that it turns the row vector into a column vector. If you use single number indexing ("x(2)") and are going to iterate through the x vector, it may not matter which you use. If you use two number indexing ("x(2,1)") or if you are going to use it for some linear algebra operations, then there is a difference between the two.

Have a good day,

Bill


reply via email to

[Prev in Thread] Current Thread [Next in Thread]