3D Logarithmic Spiral Code
2 ビュー (過去 30 日間)
古いコメントを表示
Hello,
I need to generate a 3D Logarithmic Spiral !
Can anybody help me with the code.
Thanks!!!!!!!!!
3 件のコメント
Cedric
2013 年 3 月 27 日
so you have a formula for x(t) and y(t), and you could generate a formula for z(t) as t/100 for example.
Now you want to create a vector of all times that you want to consider, e.g.
>> t = 0:0.1:100 ;
and compute x, y, and z from there. Play a bit with a smaller vector t and see what you can do, keeping in mind that multiplying vectors element by element requires a dotted operator..
>> t = 1:4
t =
1 2 3 4
>> exp(t)
ans =
2.7183 7.3891 20.0855 54.5982
>> sin(t)
ans =
0.8415 0.9093 0.1411 -0.7568
>> exp(t) * sin(t) % Wrong way to perform element-wise multiplication..
Error using *
Inner matrix dimensions must agree.
>> exp(t) .* sin(t) % Correct way; each element of the output is the
% product of corresponding elements of the inputs.
ans =
2.2874 6.7188 2.8345 -41.3200
回答 (0 件)
参考
カテゴリ
Help Center および File Exchange で Symbolic Math Toolbox についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!