How to write an complicated equation using matlab

Hello all..Can anyone tell me how to write this equation in matlab
O= arg min(|med(a^c)-b|) where c=1,2…10.
Here A and B are matrix of size 3x3.Thank you..

 採用された回答

KALYAN ACHARJYA
KALYAN ACHARJYA 2020 年 4 月 19 日
編集済み: KALYAN ACHARJYA 2020 年 4 月 19 日

0 投票

c=2 % any value within 1 to 10
a=....;% Define a and b
b=.....;
O=angle(min(abs(median(a.^c)-b)))
or
c=4; %any value within 1 to 10
a=....;% Define a and b
b=.....;
O=abs(min(abs(median(a.^c)-b)))
Or more
c=1:10;
a=magic(3); % Define any 3x3 Matrix
b=magic(3); % % Define any 3x3 Matrix
for i=1:length(c)
O{i}=abs(min(abs(median(a.^c(i))-b)))
end
O
See about arg, there is no arg function in Matlab. is it?

3 件のコメント

Sabari G
Sabari G 2020 年 4 月 20 日
Thank you for your reply..I have one doubt if c=0.1,0.2,0.3..1.How should i use them in powers.
KALYAN ACHARJYA
KALYAN ACHARJYA 2020 年 4 月 21 日
Third option
a.^c(i)
Sabari G
Sabari G 2020 年 4 月 21 日
okay.Thank you!!

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

その他の回答 (0 件)

製品

質問済み:

2020 年 4 月 19 日

コメント済み:

2020 年 4 月 21 日

Community Treasure Hunt

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

Start Hunting!

Translated by