help-octave
[Top][All Lists]
Advanced

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

Re: reshaping vector


From: fork
Subject: Re: reshaping vector
Date: Mon, 24 May 2010 22:21:16 +0000 (UTC)
User-agent: Loom/3.14 (http://gmane.org/)

>  Is there any
> particular reason for your use of square brackets?  Is it primarily
> a coding style issue?  

Sometimes it is nice to pass the results of size() directly into repmat(), or
other matrix construction functions, and one can do it like so (obviously a
silly example) using the vector arguments:

x = [1 2 3; 4 5 6]
repmat([10 20; 30 40], size(x))

One note -- sometimes I ask questions like this on the matlab listserv, since
that is a super active list and matrix manipulation is common to both octave and
matlab.  However, that doesn't give one the opportunity to thank Prof. Eaton and
the rest of the developers for a great free piece of competing software ;).







reply via email to

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