Here of three coefficients with relation to w.
A = (38.6068*ω^2-0.37)/(0.1288*ω^2+0.1396)
B = ((18.58-0.3589*A)*ω^2)/(0.37)
C = ((30.45*A*B*ω^2 ))/(0.5*(0.1288*A*ω^2+0.1396*B))
I want to plot A and B in 2D and A,B and C in 3D in matlab for interval w = (0,0.48321)
.
Note : A,B,C have relation to each other in formulas.
You have to modify the code you've posted by using the following notation in the operations:
./
, .*
, .^
this allows to perform those operations on arrays "elemt-wise".
To plot A
and B
on a 2D chart you can use the plot
built in function.
To plot A
, B
and B
on a wD chart you can use the plot3
built in function.
The 3D plot can only be a line
and not a surface since being C
a (1 x N) array (with N=length(C)
).
The updated version of you code:
omega=0:.01:0.48321;
A = (38.6068*omega.^2-0.37)./(0.1288*omega.^2+0.1396);
B = ((18.58-0.3589*A).*omega.^2)/(0.37);
C = ((30.45*A.*B.*omega.^2 ))./(0.5*(0.1288*A.*omega.^2+0.1396.*B));
The 2D plot of A
, B
, C
figure
plot(omega,A,'r','linewidth',2)
hold on
plot(omega,B,'b','linewidth',2)
plot(omega,C,'k','linewidth',2)
grid on
legend('A','B','C','location','best')
The 3D plot
figure
plot3(A,B,C,'r','linewidth',2)
grid on
xlabel('Parm. A','fontweight','bold')
ylabel('Param. B','fontweight','bold')
zlabel('Param. C','fontweight','bold')
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.