how can i use linspace to generate a row vector with two similar points?
19 views (last 30 days)
Show older comments
i am creating an initial guess vector. As i have a multipoint BVPs, i should use double entries in the vector for the interface point. i used linspace(2,20,1000). but i want it to have two 16. how can i do it?
thank you
2 Comments
dpb
on 28 Jul 2013
What's a BVP?
Please clarify what you really want...give a small example possibly explaining how you arrived at the result.
Accepted Answer
dpb
on 28 Jul 2013
Edited: dpb
on 28 Jul 2013
bp=16; % breakpoint value
sp= 2; % startpoint
ep=20; % endpoint
a0=[linspace(sp,bp,N1) linspace(bp,ep,N2)];
N1, N2 could be Ntot/2 or ratio by the distance between breakpoint and overall range to keep uniform or however is best for the particular problem.
If more breakpoints expand on the above.
2 Comments
dpb
on 28 Jul 2013
W/ time, you'll dream up a zillion other ways to code the above "plain vanilla" approach.... :)
The point of the earlier question was that there's little hope of providing a really responsive answer (as Azzi's shows) w/o the groundrules laid out clearly.
More Answers (1)
See Also
Categories
Find more on Boundary Value Problems in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!