f

#### [0 0 1 1 2 2 3 3 4 4 ... n n]

```Is there a way to achieve a vector like the one below without using loops?

[0 0 1 1 2 2 3 3 4 4 ... n n]
```
 0
uwn (103)
6/12/2013 7:51:09 AM
comp.soft-sys.matlab 211264 articles. 25 followers. lunamoonmoon (257) is leader.

3 Replies
1298 Views

Similar Articles

[PageSpeed] 50

```"Ulrik Nash" <uwn@sam.sdu.dk> wrote in message <kp999d\$a8e\$1@newscl01ah.mathworks.com>...
> Is there a way to achieve a vector like the one below without using loops?
>
> [0 0 1 1 2 2 3 3 4 4 ... n n]

You could try this:
floor(0:1/rep:n+1-1/rep)

where rep is the number of repetitions (2 in your case)
```
 0
Bart5455 (1)
6/12/2013 8:18:13 AM
```Hi,
a cool way to do that is using the kronecker product
kron(0:n,[1 1]);
```
 0
6/12/2013 8:49:12 AM
```"Ulrik Nash" <uwn@sam.sdu.dk> wrote in message <kp999d\$a8e\$1@newscl01ah.mathworks.com>...
> Is there a way to achieve a vector like the one below without using loops?
>
> [0 0 1 1 2 2 3 3 4 4 ... n n]

There is another way to achieve that. Do this like the following:
>> n=7; u(1:2:2*n+1)=0:n;
>>  u(2:2:2*n+2)=0:n;

The array u seems to be what you want.
```
 0
ye_gayev (18)
6/14/2013 7:50:08 AM

Similar Artilces:

[1 1 1 1 1 ;2 2 2 2 2 ;3 3 3 3 3 3;....;n n n n n]
Hi, Anybody knows how to create this matrix but without using any loops? a=[1 1 1 1 1 ;2 2 2 2 2 ;3 3 3 3 3 ;.......;n n n n n ] Thank you. Hana. Hana wrote: > Hi, > Anybody knows how to create this matrix but without using any loops? > a=[1 1 1 1 1 ;2 2 2 2 2 ;3 3 3 3 3 ;.......;n n n n n ] HELP REPMAT - Randy Hana wrote: > > > Hi, > Anybody knows how to create this matrix but without using any > loops? > a=[1 1 1 1 1 ;2 2 2 2 2 ;3 3 3 3 3 ;.......;n n n n n ] > > Thank you. > Hana. Hope this isn't homework. >> repmat([1:n]'...

#1 #n+1 #2n+1 #2 #n+2 #2n+2 #3 #n+3 #2n+3 #n #2n #3n #1 #2 #3 #n #n+1 #n+2 #n+3 #2n #2n+1 100 Gbps aggregate stream of 64/66b words virtual lane markers virtual lane 1 virtual lane 2 virtual lan
#1 #n+1 #2n+1 #2 #n+2 #2n+2 #3 #n+3 #2n+3 #n #2n #3n #1 #2 #3 #n #n+1 #n+2 #n+3 #2n #2n+1 100 Gbps aggregate stream of 64/66b words virtual lane markers virtual lane 1 virtual lane 2 virtual lane 3 virtual lane n Simple 66-bit word level round robin distribution Transmit PM Transmit PM Receive PM Receive PM Transmit PC Receive PC 1 0.0 1.0 0.1 0.2 0.3 1.2 1.2 1.1 0.0 1.0 0.1 1.1 2.0 3.0 4.0 6.0 7.0 9.0 10.0 11.0 12.0 13.0 14.0 15.0 17.0 18.0 19.0 2.0 3.0 4.0 5.0 6.0 7.0 8.0 9.0 10.0 11.0 12.0 13.0 14.0 15.0 16.0 17.0 1...

Notation: R(a,k) denotes the rising factorial a(a+1)...(a+k-1 ...the certificate being 2 2 2 (5 m - 12 m p - 2 m + 8 p + 3 n m - n
Notation: R(a,k) denotes the rising factorial a(a+1)...(a+k-1 ...the certificate being 2 2 2 (5 m - 12 m p - 2 m + 8 p + 3 n m - n - 4 n p + 1 + 4 p) n -------------------------------------------------------------, QED . ... Musatov ...

if time = 3 seconds, how do i set the values of the time steps 0,0.1,0.2,0.3,0.5,1.0,1.5,2.0,3.0,5.0 to -9999 from time =3 seconds
Hi &nbsp; I have 18 inputs (arrays) which contain certain statistics and if time&nbsp;&nbsp;= 3 seconds, set the values of time step 5.0 to -9999.0. &nbsp; I was wondering if there is an efficient way to do this without using a lot of case statements? &nbsp; Thank you. Hello AdrianT, it's not really clear to me what you want to do... I suspect: you have an array containing values and you want to output them with a fixed timing of 3 seconds: you should use a for loop autoindexing trough your array and sending the value to your indicator/output/whatever. Put a "wait for next multiple" into your for loop. Or do you want to have a minimum time delay of 3 seconds? Again use a for loop, get the time value and use a InRange&amp;Coerce with minimum set to 3 seconds... Or you should explain more precisely what you need... Hi Thanks for that. Let me explain. &nbsp; The time may vary. Let me give an example. if time&nbsp; = 2.1, I want to set the time step's &nbsp;3.0 and 5.0's values to -9999.0. if the time =0.1 seconds then I want to set 0.2,0.3, 0.5 etc values to -9999.0 etc .................................................................... &nbsp; Can you please help? Thank you. Hello TUDS, do you use different accounts/nicknames ? Well, that's easy, at least for a sorted array: Search for your time-value in the array (Threshold 1D array). Fill all elements from that index till the end with your "error...

PHPBB2, PHP 4.3.4, MySQL 4.1.1, Apache 2.0.49, Fedora 2
My combination is: PHPBB2, PHP 4.3.4, MySQL 4.1.1, Apache 2.0.49, Fedora 2 Anyone out there has a successful combination of newer versions ? fr gr Erik ...

Why does '[1,2,3] EQ [2]' yield zero but '[1,2,3] EQ 2' yield [0,1,0] ?
Hi all, The post title says it all. I thought "everything" in IDL was an array, but using [2] and 2 with relational operators is not equivalent... I searched the doc and newsgroup for quite a while, but obviously I did not come up with search terms that are specific enough. It took me a while to track this down in some code I was writing. My bug is now fixed *but* I don't understand why exactly. And we all know voodoo and IDL don't mix :-) can somebody clarify please? Many thanks, Gianguido PS: I have a feeling this issue came up not too long ago, just couldn't find...

TRSDOS II, version 4.2.0, 4.2.2, 4.2.4, 4.2.6 (or 4.3.x or 4.4)
Hi, Group I require a copy of the above DOS, but I need it _on disk_ as I do not have an emulator for the Model II that must be tested. Is there any possible sources of the OS on disk, or can you advise if the original 8" drive can be hooked to another device so that I can transfer an electronic copy to the disk to boot the machine? What other options do I have? Thanks L replying to my own post :-) I found an article here (http://www.tim-mann.org/trs80resources.html) where Tim describes a trick to rescue a disk's contents. This should be a workable solution...

& # 4 0 ; & # 4 4 3 0 5 ; & # 4 4 2 5 6 ; & # 4 1 ;��������� ARS���� �����ؿ�(����)@
<HTML> <HEAD> <META content="text/html; charset=ks_c_5601-1987" http-equiv=Content-Type> <STYLE> p, font, span { line-height:120%; margin-top:0; margin-bottom:0; }</STYLE> </HEAD><BODY> <p>&nbsp;</p> <P>&nbsp;</P> <p>&nbsp;</p> </BODY> </HTML> ...

& # 4 0 ; & # 4 4 3 0 5 ; & # 4 4 2 5 6 ; & # 4 1 ;@��������� ARS���� �����ؿ�@(����)
<HTML> <HEAD> <META content="text/html; charset=ks_c_5601-1987" http-equiv=Content-Type> <STYLE> p, font, span { line-height:120%; margin-top:0; margin-bottom:0; }</STYLE> </HEAD><BODY> <table border="1" width="629" bordercolor="#cccccc" bordercolorlight="#cccccc"> <tr> <td width="619" height="67"> <p align="center"><font face="����"><span style="FONT-SIZE: 11pt"></span></font></p...

& # 4 0 ; & # 4 4 3 0 5 ; & # 4 4 2 5 6 ; & # 4 1 ;��������� ARS���� �����ؿ�(����)
<HTML> <HEAD> <META content="text/html; charset=ks_c_5601-1987" http-equiv=Content-Type> <STYLE> p, font, span { line-height:120%; margin-top:0; margin-bottom:0; }</STYLE> </HEAD><BODY> <TABLE borderColor=#cccccc width=629 borderColorLight=#cccccc border=1> <TBODY> <TR> <TD width=619 height=67> <P align=center><FONT face=����><SPAN style="FONT-SIZE: 11pt"><IMG src="http://www.ezbizi.com/ezbizi/home_img/daechul_01.gif"></SPAN></FONT></P>&l...

i=infinity;0= i*sin k*pi, 1=cos k*pi, k=m/n, n=4,m=0-00; c*G=20=const, 1/sgrt2>G>0.5, 6<N = NA ^2surf/NAvol<7 ; h/N =11=const, e+i*pi; D universe =f(h)*1/ (a))^4, T=f( m, S, D)
I sincerely hope You will read the text bellow, get intrigued and discuss with some of Your colleagues. I have a feeling Your INTUITION will not allow You just to dismiss my thoughts in a trash bin. What if I give up? Please for give the messy form - form represents content, messy form allows to represent a developing idea. Rigid form can only represent dead , already solved idea- why would You want to see that? Best regards, Ivars Fabriciuss Dear Friends, 0 has infinity potential dimensions all of whom has potential to materialize -it encompasses the beginning of everything;when used...

i=infinity;0= i*sin k*pi, 1=cos k*pi, k=m/n, n=4,m=0-00; c*G=20=const, 1/sgrt2>G>0.5, 6<N = NA ^2surf/NAvol<7 ; h/N =11=const, e+i*pi; D universe =f(h)*1/ (a))^4, T=f( m, S, D)
Please give me a direction - am I totally lost in my own world and have spent 6 months in vain trying to figure this out, or is there a fruit of truth hidden somewhere? Excuse me for rapid end of some sentences and chaotic appearance of equations- i am just tired. I have spent 1 month practically thinking only about 1 thing. I need some rest and support. On other hand, this chaotically ordered text is good as it will cause confusion and will stretch imagination:) Approximately 50% of the following text is obviously right > 37,5%-is subjective <12,5%- optional Approximately 50% of peop...

Upgrade from VO 1 - 2 - 2..1 -2.2 - 2.3 -2.4 - 2.5 - 2.6 - 2.7
About upgrade 2.5 - 2.7 at \$ 384.00 For most products I'm using - the updates (2.0 - 2.1 - 2.7) are free... 2.0 to 3.0 might be worth + 10-30% of the original price? VO is + full price again & again - Full program price for every minor upgrade/bug-fix? I dropped out of the money/bugs [VO] at 2.5 after starting at 1.0 more than 10 years ago. Certainly whoever is making VO have to make a living; earning moneys: - that is OK! A 10 years old VO site; - 10 years later, how much have changed? http://www.yi.com/prany/cavo/cavofront.htm Even MS is not ...

ANN: ActivePython 2.6.2.2, 3.1.0b1.0, 2.5.4.4 is now available
I'm happy to announce that ActivePython 2.6.2.2, 3.1.0b1.0 and 2.5.4.4 are now available for download from: http://www.activestate.com/activepython/ This is a patch release that updates ActivePython to core Python 2.6.2 and 3.1b2. This release also contains updates to Tcl/Tk 8.5.7 and Tix 8.4.3. We recommend that you try 2.6 version first. See the release notes for full details: http://docs.activestate.com/activepython/2.6/relnotes.html What is ActivePython? --------------------- ActivePython is ActiveState's binary distribution of Python. Builds for Windows, Mac OS X,...

[ANN] QtRuby 1.0.8/Korundum 3.4.0/KDevelop 3.2.0
URIS http://rubyforge.org/projects/korundum/ http://developer.kde.org/language-bindings/ruby/index.html http://www.kdevelop.org/?filename=download.html NAME QtRuby 1.0.8 Korundum 3.4.0 KDevelop 3.2.0 SYNOPSIS Ruby bindings for the Qt and KDE GUI apis, combinded with an IDE for RAD DESCRIPTION Highlights from the QtRuby ChangeLog * An 'include Qt' statement in qtruby.rb where a couple of methods were being added to class Module was causing all the Qt methods to be added to Module. Oops, this a really serious bug. Various meth...

[wx 2.4.2, WinXP SP 1, Dev-Cpp 4.9.8.10 bundle, gcc 3.2, MySQL 4.0.20a-nt ] wxDbTable::Update()-ing PK field ?
I have a table with single smallint PRIMARY KEY field, but it is not AUTO_INCREMENT. wxDbTable::Update() works if any other field has been changed. If PRIMARY KEY field has been changed, nothing happens. I tried a few things, even some dirty tricks, declaring two variables thru wxDbTable::SetColDefs() for the field. One as not key field, insertable & updateable, and the other as key field, but not insertable and not updateable. Goal was to convince wxDbTable to use first variable to update field with a brand-new value, and the second one to hold old value for the automatic constru...

xcode 3.1.2 1613.0/1614.0/1591.0 (sdk 3.1.3) strikes again
Beware of a developer with access to threads: while debugging an app in xcode on ipod Xcode manages to tie up BOTH cores on mac mini (cpu idle is never above 15% and xcode cpu usage is %150-170%) I'm doing absolutely NOTHING on desktop: just sitting watching the top -o cpu output while a QA slave is trying to crash my app on the ipod tethered to the mac mini trying to move a cursor in a source code window is a rather painful experience naturally gdb barely uses ANY cpu cycles, ditto the userspace kernel processes I dare not to think what xcode predecessor was like if peo...

[tao-users] Use of TAO_OutputCDR and ACE_Message_Block in CORBA::Any from TAO 1.4.1|ACE 5.4.1 to TAO2.2.0|ACE 6.2.0
This is a multipart message in MIME format. ------=_NextPart_000_00BF_01CEA8D4.9E005C80 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable TAO VERSION: 2.2.0 ACE VERSION: 6.2.0 =20 HOST MACHINE and OPERATING SYSTEM: x86_64 and Red Hat - Linux 2.6.18-194.26.1.el5 =20 TARGET MACHINE and OPERATING SYSTEM, if different from HOST: =20 COMPILER NAME AND VERSION (AND PATCHLEVEL): gcc (GCC) 4.8.1 =20 THE \$ACE_ROOT/ace/config.h FILE: config-linux.h =20 THE \$ACE_ROOT/include/makeinclude/platform_macros.GNU FILE: platform_linux.GNU =20 CONTENTS OF \$ACE_ROOT/bin/MakeProjectCreator/config/default.features (used by MPC when you generate your own makefiles): =20 AREA/CLASS/EXAMPLE AFFECTED: TAO_OutputCDR and ACE_Message_Block. =20 DOES THE PROBLEM AFFECT: EXECUTION. My application is affected. =20 SYNOPSIS: The code that extract data from CORBA::Any using TAO_OutputCDR and ACE_Message_Block for user defined types works properly in the old platform (TAO 1.4.1|ACE 5.4.1), but not in the new one(ACE 6.2.0). =20 DESCRIPTION: The code in the =93REPEAT BY=94 section works fine in the old platform = for user defined types, that is, the TAO_OutputCDR and ACE_Message_Block objects have the same length, but in the new platform th...

Oracle server 9.2.0.1.0, Client 9.2.0.4.0, Red Hat Linux enterprise advanced server 2.1
Hi Everybody, My Database server is running on Red Hat Linux enterprise advanced server 2.1, And my Oracle version is 9.2.0.1.0. My Client mechine also Red Hat Linux enterprise advanced server 2.1 , Oracle client version is 9.2.0.4.0. I am running a web application. Our application is in Magic edeveloper. I connect to Oracle using oracle gateway to my application. My Problem is my application is is becoming slow. I am not able to trace where the problem is. Before our application was running fine. recently i upgraded Oracle client version to 9.2.0.4.0. My Oracle client & server versi...

Pythonutils 0.2.2 , ConfigObj 4.0.0 Beta 5, odict 0.1.1
The response to pythonutils__ was very good. Especially the odict__ module (ordered dictionary) - it's had over one hundred and fifty downloads already. Thanks to some useful user feedback, Nicola Larosa has updated and improved it. More embarassingly we've done a bugfix release of ConfigObj__ - now up to beta 5. This fixes another couple of bugs - we aim to get out of beta someday...... All this is my way of saying that *odict 0.1.2*, *pythonutils 0.2.2*, and *ConfigObj beta 5*, are all available from the `Voidspace Modules`__ page. __ http://www.voidspace.org.uk/python/pythonutils...

Can I update from AIX 4.3.2.0 to 4.3.3.0
I downloaded the 4330001.tar.gz for a start and gzip -d -c ~rmuforo/test/4330001.tar.gz | tar -xvf inutoc /usr/sys/inst.images installp -acgXd /usr/sys/inst.images bos.rte.install but it failed when I ran smit update all. Do I have to do the a whole complete over write install. Thanks for you help. "Ray Muforosky" <ramey@onebox.com> schrieb im Newsbeitrag news:41b0d166.0404212031.47f2449c@posting.google.com... > I downloaded the 4330001.tar.gz for a start and > > gzip -d -c ~rmuforo/test/4330001.tar.gz | tar -xvf > inutoc /usr/sys/inst.images > installp -ac...

EST5EDT,M3.2.0,M11.1.0.. DST 4.3.3
Hello all, if you don't specify the time, which is 2am what will be default time? Will it change at midnight, if you do not put 2am? should it be like this: EST5EDT,M3.2.0/2:00:00,M11.1.0/2:00:00.. EST5EDT,M3.2.0,M11.1.0 <-- this is how IBM suggested it, without specifying the time which variable will work? Thanks pinoy If you do not specify a time, it defaults to 2AM, all DST changes have been at 2AM for as long as I can remember, so that's the default. You shouldn't need to specify a time. On Feb 23, 2:12 pm, "pinoy2ser" <pinoy2...@gmail.com> wrote: ...

Movable Python 1.0.0 for Python 2.3 & 2.4
It's finally happened, `Movable Python <http://www.voidspace.org.uk/python/movpy/>`_ is finally released. Versions for Python 2.3 & 2.4 are available from `The Movable Python Shop <http://voidspace.tradebit.com/groups.php>`_. The cost is =A35 per distribution, payment by PayPal. =A31 from every distribution goes to support the development of `SPE <http://pythonide.stani.be/>`_, the Python IDE. This gives you free support (via the `Movable Python Mailing List <http://groups.google.com/group/movpy>`_), and access to updates, for a year. There is a minor issue ...

Movable Python 1.0.0 for Python 2.3 & 2.4
It's finally happened, `Movable Python <http://www.voidspace.org.uk/python/movpy/>`_ is finally released. Versions for Python 2.3 & 2.4 are available from `The Movable Python Shop <http://voidspace.tradebit.com/groups.php>`_. The cost is =A35 per distribution, payment by PayPal. =A31 from every distribution goes to support the development of `SPE <http://pythonide.stani.be/>`_, the Python IDE. This gives you free support (via the `Movable Python Mailing List <http://groups.google.com/group/movpy>`_), and access to updates, for a year. There is a minor issue with the Python 2.2 version. This will be fixed and released in the next few days. In the meantime the previous version (0.4.6) is available for download from the shop. If you purchase this distribution your year will run from the date of the release of 1.0.0. Paying for **Movable Python** supports the development of the other Open Source `Voidspace Python Projects <http://www.voidspace.org.uk/python/index.shtml>`_. What is Movable Python ? =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D **Movable Python** is a distribution of Python for Windows that doesn't need to be installed. It easily fits onto a USB memory stick. Python on a stick. It is integrated with SPE, the Python IDE, to make **Movable Python** a portable Build, Test, and Run environment. It has a nice GUI to launch programs and control its behaviour. Movable Python...

Web resources about - [0 0 1 1 2 2 3 3 4 4 ... n n] - comp.soft-sys.matlab

Bernie Sanders' upset victory in Michigan came just two days after he stood on the debate stage in the perennially beleaguered city of Flint, ...

New Android OS brings split-screen apps
Split-screen multitasking and improved notification controls are among the new features being added to the Android operating system (OS).

George R.R. Martin Is Not Dead: ‘Game Of Thrones’ Novelist Mistaken For Beatles Producer After News Of ...
Yesterday, the music industry was devastated after news of George Martin’s passing spread online. George Martin, a record producer known as the ...

NKorea to liquidate SKorean assets, fires missiles into sea
SEOUL, South Korea (AP) — North Korea responded Thursday to new sanctions from South Korea by firing short-range ballistic missiles into the ...

Bette Midler Challenges Kim Kardashian To Put Her ‘Selfie To Work’ And Donate To Charity
The online Twitter exchange between Kim Kardashian and Bette Midler all started a few days ago when the Keeping Up with the Kardashians star ...

Search on for Suspects in Pa. Shooting That Left 5 Dead
Police are searching for at least two suspects in a shooting at a backyard party that left five people dead and three wounded in suburban Pittsburgh ...

BREAKING NEWS: ISIS Commander Still Alive, Pentagon Air Strike Fails to Kill Former U.S. Military ‘Star ...
After Pentagon released a statement regarding the air strike they did to target senior ISIL leaders, it was recently reported that they failed ...

Eddy Cue Fears Surveillance State if FBI Wins iPhone Unlock Case
Apple VP Eddy Cue says the U.S. government could force Apple to secretly implement surveillance technology in its devices if the FBI's current ...

Dr. Luke’s Lawyers Deny Rumors Sony Will Drop Him Amid Legal Battle With Kesha
Dr. Luke has denied reports suggesting that Sony is about to drop him amid his legal battle with pop singer Kesha, ABC News reports. Dr. Luke ...

As seen in I, Robot: Goodyear unveils spherical tires for self-driving cars
What will the cars of the future be like? It’s fun to imagine how new technologies and design trends will influence future cars. Car bodies ...

Resources last updated: 3/10/2016 12:20:08 PM