How i can plot the below sigmoid function?

8 次查看(过去 30 天)
p=2;%Gradient coefficent
z=[0:0.1:1/2]*1e-3;
G=1-1/2*(((h/2)-z)/(h/2)).^p; Sigmoid fuction
z1=[-1/2:0.1:0]*1e-3;
G1=1/2*(((h/2)+z)/(h/2)).^p; Sigmoid function
How i can plot the sigmoid function in the all thickness [-1/2:1/2] ?
p=2;%Gradient coefficent
z=[0:0.1:1/2]*1e-3;
G=1-1/2*(((h/2)-z)/(h/2)).^p; Sigmoid fuction
z1=[-1/2:0.1:0]*1e-3;
G1=1/2*(((h/2)+z)/(h/2)).^p; Sigmoid function
Hi,
I am trying to plot the below sigmoid function versus all thickness.
Any help on how to do that?
Thanks.

回答(1 个)

KALYAN ACHARJYA
KALYAN ACHARJYA 2021-3-5
It is all about specific parameter values ​​how we know this, because we cannot be from the same subjective field.
  • Define the typical values parameter.
  • Expression or equation must be correct.
Here I have shown how you can obtain such a plot, but note that, to get exactly the same plot, the parameter values ​​and expressions must be the same according to the literature.
p=1:10; %P data is OK
h=4;
z=-0.2:0.01:0.2;
for i=1:length(p)
G=1-1/2*(((h/2)-z)/(h/2)).^p(i);
plot(z./h,G);
hold on
grid on;
end
Please do modify accordingly, more note on x data, which is z/h
  1 个评论
Ezzin Hamdi
Ezzin Hamdi 2021-3-5
Thanks for your reply.
I can do this expression easily, i work with Matlab for years.
But the expression of G is different in [-1/2:0] interval, G=1/2*(((h/2)+z)/(h/2)).^p(i);
i would like to plot the two different functions in same graph.
%sigmoid distributions,
clear ,
close all
h=1e-3;
p=2;
z=[0:0.1:1/2]*1e-3;
G=1-1/2*(((h/2)-z)/(h/2)).^p;
z1=[-1/2:0.1:0]*1e-3;
G1=1/2*(((h/2)+z)/(h/2)).^p;

请先登录,再进行评论。

类别

Help CenterFile Exchange 中查找有关 Surface and Mesh Plots 的更多信息

产品


版本

R2016a

Community Treasure Hunt

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

Start Hunting!

Translated by