Graphing a function with multiple symbolic variables as a 3D surface

조회 수: 8 (최근 30일)
Hi there,
I have a function that consists of 2 symbolic variables and a constant. I am trying to graph the function as a 3d surface between set boundaries.
I am attempting to graph
Y=-(((c^2)-r^2)/(r*2))*dz
Where r is a symbolic variable and dz is a function of the symbolic variable z. c is a constant.
I need my r values to be between 0 and 25 and z to be between 0 and 105.
I tried using ‘subs’
Z=linspace(0,105,6)
R=linspace(0,25,6)
Y2=subs(Y,[r,z],[R,Z])
However, this leads to an error.
So, I am having trouble figuring out how to introduce these boundaries to the symbolic variables in order to graph the function.
Would love to know if there is a way to do this?
Thanks so much!

채택된 답변

Walter Roberson
Walter Roberson 2021년 2월 4일
Y2 = subs(Y,{r,z},{R,Z.'})
  댓글 수: 7
Navya Jay
Navya Jay 2021년 2월 4일
So sorry! I simplified the formula as I wrote it here but forgot to write the c(x) as c. c(x) is from a reference to a spreadsheet, but in the formula its a constant (specifically 27.5). dz is a function of z.
Navya Jay
Navya Jay 2021년 2월 4일
Thank you so much for your help! I used
Y2=@(r,z)-(((c(x).^2)-r.^2)./(r*2)).*dz
and I no longer get that error!

댓글을 달려면 로그인하십시오.

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Spline Postprocessing에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by