フィルターのクリア

How to convert this fplot to 3D plot view

41 ビュー (過去 30 日間)
Dilip Jose
Dilip Jose 2024 年 8 月 6 日 3:40
コメント済み: Dilip Jose 2024 年 8 月 7 日 6:16
syms z
t=0.2;
sc=0.6;
s1=z;
s2=2*(sqrt(t));
x=(s1./s2);
c5=exp((2*x*(sqrt(sc*t))));
c6=erfc((x*sqrt(sc))+(sqrt(t)));
c7=exp((-2*x*(sqrt(t*sc))));
c8=erfc((x*sqrt(sc))-(sqrt(t)));
q=((1/2)*((c5*c6)+(c7*c8)));
xlim([0 5]);
ylim([0 1]);
fplot(z,q)
hold on
legend ("sc=2.01","sc=","sc=0.6");
Warning: Ignoring extra legend entries.
xlabel("η (Similarity parameter)");
ylabel("C (Concentration)");

採用された回答

Matt J
Matt J 2024 年 8 月 6 日 4:19
view(3)
Warning: Ignoring extra legend entries.
  2 件のコメント
Dilip Jose
Dilip Jose 2024 年 8 月 6 日 4:35
編集済み: Dilip Jose 2024 年 8 月 6 日 4:35
tan q.....is there any possible to view like mesh ?
Dilip Jose
Dilip Jose 2024 年 8 月 6 日 4:36

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

その他の回答 (1 件)

Shishir Reddy
Shishir Reddy 2024 年 8 月 6 日 9:50
Hi Dilip
To convert a 2D plot to a 3D mesh, a third variable needs to be introduced. In this case, the variable sc can be considered as third dimension and the mesh plot can be generated for function q against z and sc.
This can be implemented in MATLAB as follows
% Define symbolic variables
syms z sc
t = 0.2;
% Intermediate calculations
s1 = z;
s2 = 2 * (sqrt(t));
x = (s1 ./ s2);
c5 = exp((2 * x * (sqrt(sc * t))));
c6 = erfc((x * sqrt(sc)) + (sqrt(t)));
c7 = exp((-2 * x * (sqrt(t * sc))));
c8 = erfc((x * sqrt(sc)) - (sqrt(t)));
q = ((1 / 2) * ((c5 * c6) + (c7 * c8)));
% Define the range for z and sc
z_range = [0 5];
sc_range = [0.5 2.5]; %these values can be changed as per requirement
% Plot the 3D surface using fsurf with symbolic expression
fsurf(q, [z_range sc_range])
xlabel('z (Similarity parameter)')
ylabel('sc')
zlabel('C (Concentration)')
title('3D Surface Plot of Concentration vs Similarity Parameter and sc')
For more information regarding the ‘fmesh’ function, kindly refer the following documentation https://www.mathworks.com/help/matlab/ref/fmesh.html
I hope this helps.
  1 件のコメント
Dilip Jose
Dilip Jose 2024 年 8 月 7 日 6:16
great sir thank u

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

カテゴリ

Help Center および File ExchangeSurface and Mesh Plots についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by