Constraints on the linspace command

3 ビュー (過去 30 日間)
Zena Assaad
Zena Assaad 2015 年 9 月 29 日
コメント済み: Zena Assaad 2015 年 10 月 20 日
Hi all,
A while back I asked a question about getting a very simple path between two 3D Cartesian points (x,y,z) and one of the answers was using the linspace command which worked perfectly. My problem now requires a constraint on the z coordinate:
z >= 10
When I input the z >= 10 command nothing changes, i.e. the answer is still below 10. Can you apply these constraints to a linspace command or will I now have to find an alternative approach? x and y are still unconstrained and my problem is still finding a path between (x1,y1,z1) and (x2,y2,z2). The z >= 10 constraint is the only constraint on the path.
Thanks.
  3 件のコメント
Walter Roberson
Walter Roberson 2015 年 9 月 29 日
John D'Errico
John D'Errico 2015 年 9 月 29 日
編集済み: John D'Errico 2015 年 9 月 29 日
Your question makes no sense at all.
If the start and end points of a path both satisfy z >= 10, then for a linear path, so must (and will) EVERY point in between.
Even if the path is allowed to be nonlinear, as long as it is continuous, it STILL must satisfy that condition at the endpoints. And if it does, then linspace is fine.
So what is the problem?!? You need to explain yourself far more clearly.

サインインしてコメントする。

採用された回答

Jan
Jan 2015 年 9 月 29 日
編集済み: Jan 2015 年 9 月 29 日
Based on James Tursa's answer:
Point1 = whatever;
Point30 = whatever;
Pmatrix = [linspace(Point1(1), Point30(1), 30); ...
linspace(Point1(2), Point30(2), 30); ...
max(10, linspace(Point1(3), Point30(3), 30))];
  1 件のコメント
Zena Assaad
Zena Assaad 2015 年 10 月 20 日
This worked well. Thank you.

サインインしてコメントする。

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeLogical についてさらに検索

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by