??? Subscript indices must either be real positive integers or logicals.

Help. I am very new to MATLAB and I am having problems creating a for loop within a for loop in order to draw a ruled surface.
Here is the script that makes the message appear above:
for u=0:.05:1
for v=0:.005:1
P=[1,1];
P1=[5,1];
P2=[2,4];
P3=[6,3];
puvx=P+u*(P1-P);
puvy=P2+u(P3-P2);
plot(puvx,puvy);
grid on;
axis square;
hold on;
end
end
What does this mean and how can I fix this? I am so lost. Thank you, Rachel

 採用された回答

Razvan
Razvan 2012 年 10 月 10 日

1 投票

You forgot an "*"
puvy = P2 + u * (P3 - P2);

2 件のコメント

Rachel
Rachel 2012 年 10 月 10 日
It still didn't help me out completely. I actually needed to reformat my answer to include the bezier equation as well as the ruled surface equation for both G(u) and Q(u). I did this, and it worked.
Razvan
Razvan 2012 年 10 月 10 日
Well, I answered only what you asked... ``What does this mean and how can I fix this?''

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

その他の回答 (0 件)

カテゴリ

ヘルプ センター および File ExchangeSymbolic Math Toolbox についてさらに検索

質問済み:

2012 年 10 月 10 日

Community Treasure Hunt

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

Start Hunting!

Translated by