Code covered by the BSD License  

Highlights from
LINSPACE3: linearly spaced vector defined by three points

Be the first to rate this file! 2 Downloads (last 30 days) File Size: 1.62 KB File ID: #28553

LINSPACE3: linearly spaced vector defined by three points

by Sky Sartorius

 

25 Aug 2010

Generate a vector as linearly spaced as possible while still including three defined points.

| Watch this File

File Information
Description

LINSPACE3 linearly spaced vector including a defined middle point.

LINSPACE3(X1, X2, X3) generates a row vector of 100 points between X1 and X3 as linearly spaced as possible such that the vector contains X2.
 
LINSPACE3(X1, X2, X3, N) generates a row vector of N points.
  
LINSPACE3 will always contain X1, X2, and X3 without repeating an element.
  
For N < 3, LINSPACE3 returns the shortest possible vector containing all of X1, X2, and X3. This is normally [X1 X2 X3]. However, if X1=X2 or X2=X3, LINSPACE3 returns [X1 X3].

One use LINSPACE3 is, for example, in generating points to evaluate in a sensitivity study where one decision variable, at a certain point (X2), is also restricted by bounds (X1, X3).

  

Acknowledgements

Cosspace and Sinspace inspired this file.

This file inspired Core: Conceptual Optimization Of Rotorcraft Environment.

MATLAB release MATLAB 7.5 (R2007b)
Tags for This File  
Everyone's Tags
distributed, linspace, logspace, spaced, spacing, vector
Tags I've Applied
Add New Tags Please login to tag files.
Please login to add a comment or rating.

Contact us