cos block error (simulink)
显示 更早的评论
采纳的回答
更多回答(1 个)
Paul
2023-1-14
0 个投票
Base Simulink doesn't have a block that implements functions cosd or cospi. Maybe some other toolbox does. If not, both of those functions support code generation so you can use the Matlab Function block and call either (or both of them) from there.
5 个评论
Paul
2023-1-15
Does the Spherical to Cartesian block come with Simulink or one of the toolboxes or blocksets from the Mathworks? If so, please provide a link to the doc page. If not, do you have access to the block implementation?
기범
2023-1-16
I couldn't add it because I couldn't find it, which is why I asked for the doc page. Did you find that block in one of The Mathworks products in the Simulink Library browswer? If so, which one?
Anyway, if you want to use degrees instead of radians in your model, it looks like you can implement the three equations in that block in your own Matlab Function using cosd and sind.
기범
2023-1-17
Paul
2023-1-17
I never said to use syms. I did say to use cosd, etc. if you want have all your angles defined in degrees. So, if theta, phi, and psi are all in degrees on input, then we have
x = r.*sind(phi).*cosd(theta)
and similar for y and z
类别
在 帮助中心 和 File Exchange 中查找有关 Variables 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!


