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일

0 개 추천

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

EldaEbrithil
EldaEbrithil 2021년 5월 20일
Hi Cris thank you for the help
"What does it say (all the red text)?"
Vectors must be the same length.
"Are they the same length?"
*x is 1x76800 double, y is 1x14 double, z is 76800x14 double*
Is it possible to plot z(x,y) even if x and y have different lengths?
Cris LaPierre
Cris LaPierre 2021년 5월 20일
No, it is not possible to plot vectors of different length.
They need to be the same length because they create a coordinate for each point.
There may be a different solution, but I'd need to know more about the data. Could you explain what values of X, Y and Z should be use to plot the 15th row of Z?
EldaEbrithil
EldaEbrithil 2021년 5월 20일
ok i see, let's try in this way... now suppose to have an y with this dimension 76800x14 double and x 76800x14 double.
This is Y:
This is X:
This is Z:
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개)

카테고리

도움말 센터File Exchange에서 Graphics Performance에 대해 자세히 알아보기

제품

릴리스

R2021a

질문:

2021년 5월 20일

댓글:

2021년 5월 20일

Community Treasure Hunt

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

Start Hunting!

Translated by