Search
Code Directory
 ASP
 ASP.NET
 C/C++
 CFML
 CGI/PERL
 Delphi
 Development
 Flash
 HTML
 Java
 JavaScript
 Pascal
 PHP
 Python
 SQL
 Tools
 Visual Basic & VB.NET
 XML
New Code
The C# OCR Library 2020.11
SentiVeillance SDK Trial 7.3.2020.11.30
VaxVoIP WebPhone SDK 4.0.6.0
SentiMask SDK Trial 2.0_193121
C# QR Code Generator 2020.12
How to Read Text from an Image in C# 2020.12
The .Net PDF Library 2020.12.3
fsMediaLibrary.NET 2019.11.0
Entity Developer 6.9.1112
OrgChart JS 7.5.40
LinqConnect 4.9.2096
SSIS Data Flow Components 1.15
IP2Location Geolocation Database Oct.2020
Luxand FaceSDK 7.2
dbForge Data Compare for PostgreSQL 3.3.6
Top Code
IcrediBB Bulletin Board System 1.0
Azizi search engine script PHP 4.1.10
Theater Management System Script 1.0.4
Sportsbook software by BOOKIE Software 3.01
Form Designer 3.5
Direx-Directory Dino
#7 Components - TRestructure Pro 2.14
Php my auctions v1.53
i-netsolution School Management Software 1.0.4
Virtual Desk 1.1
Sothink SWF Decompiler 2002 Pro
Online Poker Script 1.0
DMAIG Alumni Management System 1.0
GUI for fuzzy based Washing Machine 1.0
py2cpp, a Python to C++ converter 1.0
Top Rated
Uber Clone with Safety Measure Addons 2.0
Answers phpSoftPro 3.12
phpEnter 5.1.
Quick Maps For Dynamics CRM 3.1
Single Leg MLM 1.2.1
Azizi search engine script PHP 4.1.10
Paste phpSoftPro 1.4.1
Extreme Injector 3.7
Apphitect Airbnb Clone Script 1.0
Deals and Discounts Website Script 1.0.2
Pro MLM 1
Solid File System OS edition 5.1
Classified Ad Lister 1.0
Aglowsoft SQL Query Tools 8.2
ICPennyBid Penny Auction Script 4.0
Choosse randomly number of elements from a vector 1.0
File ID: 83332






Choosse randomly number of elements from a vector 1.0
Download Choosse randomly number of elements from a vector 1.0http://www.mathworks.comReport Error Link
License: Shareware
File Size: 10.0 KB
Downloads: 6
Submit Rating:
Choosse randomly number of elements from a vector 1.0 Description
Description: function [out]=random2(ini,fin,num)
% Choosse randomly a number (num) of elements from a vector [ini:fin]
% Randomly change the position of the vector. in pairs of twos
%
% Imput:
% ini: Beginning of the vector
% fin: End of the vector
% nun: Number of elements to choose from the range of vector [ini:fin]
%
% Output
% output vector
%
% Example
%
% [out]=random2(-20,20,10)
%
% out =
% -1 5 18 -3 1 -17 15 7 3 -6
%
% [out]=random2(5,50,10)
%
% out =
% 29 19 20 47 43 18 14 48 23 28

vr=ini:fin; % Reference Vector
lon=fin-ini; % variation or range of the vector

for nv=1:5*length(vr) % vector length.
p1=ceil(lon*rand); % randomly chooses position to move.
p2=ceil(lon*rand); % randomly selects the position where it is going to move.
tp=vr(p1); % temporal position.
vr(p1)=vr(p2); % Change inicial by end position.
vr(p2)=tp; % Change end by inicial position.
end

out=vr(1:num); % output vector

License: Shareware

Related: lengthvr, Length, dceillonrand, chooses, variation, lon dfinini, dinifin, Reference, Vector

O/S:BSD, Linux, Solaris, Mac OS X

File Size: 10.0 KB

Downloads: 6



More Similar Code

Two approaches to generate all combination of elements from a number of sets. Compares "classic" statically coded algorithms to a pythonic on-the-fly generation of specific algorithm code.



This function is based on
MyBlob toolbox, and it's used to create test environments starting
from existing databases, copying a fixed number of elements from
eache table of the source database to test one.
I'm not related to...



Creates a number of samples from a specified number of dimensions and centers them around a given mean, and within a given covariance range. You might not find it very useful, but hey, I need something to do this so why not.

To use:



This plugin will allow you to show specific number of posts from a selective category. To use this plugin, you have to place a tag in the following format in your posts or pages: [pbc=CategoryID count=num_of_posts]

Example

To...



A simple plugin that displays a specified number of posts from a category using shortcodes. The category list can be made public or private. The results are not paged.

Installation :

1. Upload plugin-name.php to the...



SilWeb is a phonological parser for returning prosodic and constitutive composition as stress acent, phonemic information and number of sillables from a phonological transcription of written words in Brazilian Portuguese.



This short but practical script lets you limit the number of checkboxes within a group that can be checked.

For example, you may have a list of 5 checkboxes, but wish to allow the user only the ability to check a maximum of 2 at any...



Get the number of days in a month is a tutorial which helps the users how to obtain the number of days in a month with the help of ASP. This is a simple and more useful for the novice programmers how to obtain the number of days using ASP server...



This code lets you retrieve multiple elements from a list at one time



This program calculates the number of flushes in a number of deals of a poker hand. You can tell it to deal say 10,000 hands and see how many were flushes. This is basically my first Python program.

User Review for Choosse randomly number of elements from a vector
- required fields
     

Please enter text on the image