Help with the below question

1 次查看(过去 30 天)
Amy Topaz
Amy Topaz 2022-3-30
编辑: Tala 2022-3-30
x = -10:0.1:10;
y = [1 6 0.03 0.08 10]';
A = 23 * (atan((0.005 + y)./x.^2));
B = diff(A,1,2)/0.1;
plot(x(1:end-1),B')
How to get the maximum value in each of the obtained plots for the mentioned y values?

回答(2 个)

Sam Chak
Sam Chak 2022-3-30
I think you can use the max() function.
max(B(1,:))
max(B(2,:))
max(B(3,:))
max(B(4,:))
max(B(5,:))

Tala
Tala 2022-3-30
编辑:Tala 2022-3-30
x = -10:0.1:10;
y = [1 6 0.03 0.08 10]';
A = 23 * (atan((0.005 + y)./x.^2));
B = diff(A,1,2)/0.1;
plot(x(1:end-1),B')
[val, indx] = max(B,[],2);
hold on
for i=1:length(indx)
plot(x(indx(i)),val(i),'d')
end

类别

Help CenterFile Exchange 中查找有关 Logical 的更多信息

标签

Community Treasure Hunt

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

Start Hunting!

Translated by