Realize a 3d line plot

7 ビュー (過去 30 日間)
EldaEbrithil
EldaEbrithil 2021 年 5 月 20 日
コメント済み: EldaEbrithil 2021 年 5 月 20 日
Hi all
i need to realize a 3d plot for displaying 3 connected quantities.
for i=1:length(i_ed)
for j=1:length(x)
if K1(i,j)>0
psl(i,j)=(70*(W_end_t(i)/Sr(i))*K1(i,j)*K2(i)*K3*acg(i))*1000;%N/m^2 RES22 (61)
end
end
end
plot3(L_end,x,psl)
xlabel('L')
ylabel('x')
zlabel('Psl')
hold on
where L_end has length(i_ed) elements. For better understanding the problem, x/L_end varies between very small values to 1. My goal it is to graph in the same 3d plot many curves as L_end length.
Thank you for the help!

採用された回答

Cris LaPierre
Cris LaPierre 2021 年 5 月 20 日
You must be getting an error message. What does it say (all the red text)?
Check that your inputs are what plot3 expects.
plot3(X,Y,Z) plots coordinates in 3-D space.
  • To plot a set of coordinates connected by line segments, specify X, Y, and Z as vectors of the same length.
  • To plot multiple sets of coordinates on the same set of axes, specify at least one of X, Y, or Z as a matrix and the others as vectors.
In your case, it appears X and Y are vectors. Are they the same length?
Z appears to be a matrix. Do the number of rows match the lengths of X and Y?
  5 件のコメント
Cris LaPierre
Cris LaPierre 2021 年 5 月 20 日
編集済み: Cris LaPierre 2021 年 5 月 20 日
Try to plot it. What happens? How does that compare to what you want?
EldaEbrithil
EldaEbrithil 2021 年 5 月 20 日
Ok it works!!
thank you very much!!

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

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeDiscrete Data Plots についてさらに検索

製品


リリース

R2021a

Community Treasure Hunt

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

Start Hunting!

Translated by