How to vectorize this function?
1 回表示 (過去 30 日間)
古いコメントを表示
I have the following function:
x3=@(phi) (R-((3-2.*sin(phi))/(1-0.5.*sin(phi)).*R)/4).*cos(phi)
I read some articles saying I have to use elementwise operations but I still get a warning.
Thanks in advance!
0 件のコメント
回答 (1 件)
Alan Stevens
2021 年 1 月 10 日
You need a ./ (i.e. dot /)
x3=@(phi) (R-((3-2.*sin(phi))./(1-0.5.*sin(phi)).*R)/4).*cos(phi)
^
参考
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!