I didn't understand it how they completed it?

4 ビュー (過去 30 日間)
Mohit
Mohit 2024 年 8 月 4 日
編集済み: Walter Roberson 2024 年 8 月 5 日
  2 件のコメント
John D'Errico
John D'Errico 2024 年 8 月 4 日
Please stop posting your homework questions with no effort made. Future questions like this will be closed as soon as I see them, if you cannot make an effort. Homework is yours to do.
Sam Chak
Sam Chak 2024 年 8 月 4 日
It appears that you have two open questions that have been answered, but you have not followed up to provide an update. Instead, you have opened a third homework question. I would encourage you to take some time to review the solutions provided for the other two homework questions:
By reviewing the provided solutions, you may gain a better understanding of how to approach and complete these types of problems in MATLAB. Taking the time to thoroughly understand the previous solutions can help you make progress on your current homework question.

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

回答 (1 件)

VBBV
VBBV 2024 年 8 月 4 日
編集済み: VBBV 2024 年 8 月 4 日
@Mohit Define the symbolic variables d & theta for the given equation to be solved
%
syms d theta
x = [d theta]; % define a symbolic vector of unknown variables , depth (d) and theta
fminsearch(@f,[25 1.5]) % give initial values based on the answer options and solve using fminsearch
ans = 1x2
14.8119 1.0472
<mw-icon class=""></mw-icon>
<mw-icon class=""></mw-icon>
% use explicit function call
function y = f(x)
y = 380./x(1) - x(1)/tan(x(2)) + 2*x(1)/sin(x(2));
end
  1 件のコメント
Walter Roberson
Walter Roberson 2024 年 8 月 5 日
編集済み: Walter Roberson 2024 年 8 月 5 日
? Defining the symbolic variables does not appear to do anything useful here??
Maybe if you had used
syms d theta
x = [d theta]; % define a symbolic vector of unknown variables , depth (d) and theta
f(x)
ans = 
fminsearch(@f,[25 1.5]) % give initial values based on the answer options and solve using fminsearch
ans = 1x2
14.8119 1.0472
<mw-icon class=""></mw-icon>
<mw-icon class=""></mw-icon>
% use explicit function call
function y = f(x)
y = 380./x(1) - x(1)/tan(x(2)) + 2*x(1)/sin(x(2));
end

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

Community Treasure Hunt

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

Start Hunting!

Translated by