Diagonal of a quadrilateral
1 次查看(过去 30 天)
显示 更早的评论
How do you determine the length of one diagonal of a quadrilateral using a user defined function. The input parameters are AB, BC, CD, DA, AC. Find DB. Here is what I have so far: Function(quadrilateral): function x=quadrilateral(AB,BC,CD,DA,AC) x=DB=(DA*(BC)+AB*(CD))/AC end Script: x=quadrilateral(9,3,4,5,6) disp(x) How do I define the function 'x' in such a way so that the equation for finding the diagonal of a quadrilateral is assigned to it?
1 个评论
Adam
2015-11-10
'x' is a variable and your code appears to already do that, in so much as it assigns the output of your function to 'x', I haven't checked that the body of your function is correct.
采纳的回答
更多回答(0 个)
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Operating on Diagonal Matrices 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!