fzero with function in matrix

4 ビュー (過去 30 日間)
Simo
Simo 2020 年 3 月 26 日
編集済み: Matt J 2020 年 3 月 26 日
I have to solve a matrix of function and then search the zero
I write a simpler code.
syms x
a=[sin(x),1;1,1];
b=[1/cos(x);1];
c=a*b;
y=c(1,1)-1;
fzero(y,[-1,1])
any suggest please?
I even tried to define the function in other way but then I wasn't able to solve the matrix product
f1=@(x)sin(x);
f2=@(x)(1/cos(x));
a=[f1,1;1,1];
b=[f2;1];
  1 件のコメント
Torsten
Torsten 2020 年 3 月 26 日
Insert the line
y=matlabFunction(y);
after you defined
y=c(1,1)-1;

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

採用された回答

Matt J
Matt J 2020 年 3 月 26 日
編集済み: Matt J 2020 年 3 月 26 日
syms x
a=[sin(x),1;1,1];
b=[1/cos(x);1];
c=a*b;
x=fzero( matlabFunction(c(1)-1) , pi/4 )

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeNumber Theory についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by