How to write an complicated equation using matlab

1 view (last 30 days)
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..

Accepted Answer

KALYAN ACHARJYA
KALYAN ACHARJYA on 19 Apr 2020
Edited: KALYAN ACHARJYA on 19 Apr 2020
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?

More Answers (0)

Categories

Find more on Image Processing Toolbox in Help Center and File Exchange

Products

Community Treasure Hunt

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

Start Hunting!