I cannot extract data from syms surface plot: Struct contents reference from a non-struct array object
显示 更早的评论
Hi!,
When I am trying to extract (x,y,z) data from a surface plot generated by the following code:
syms q_par_pipi_2 q_perp_pipi_2 Chi_xx_pipi_2
qx_pipi_2=q_par_pipi_2./sqrt(2);
Gamma_q_par_pi0_1=(1/2)*(cos(q_par_pi0_1)+1);
omega_bq_par_pi0_1=2*J*sqrt((1-Gamma_q_par_pi0_1)*(1+Gamma_q_par_pi0_1+J_perp_1/(2*J)));
omega_aq_par_pi0_1=2*J*sqrt((1+Gamma_q_par_pi0_1)*(1-Gamma_q_par_pi0_1+J_perp_1/(2*J)));
A1=q_perp_pi0_1*d/2;
B1=J*(1-Gamma_q_par_pi0_1)/omega_bq_par_pi0_1;
C1=(J*(1-Gamma_q_par_pi0_1)+(1/2)*J_perp_1)/omega_aq_par_pi0_1;
Chi_xx_pi0_1=(cos(A1)^2)*B1+(sin(A1)^2)*C1;
fsurf(Chi_xx_pi0_1,[0 1 0 1],'DisplayName','(pi,0), J_perp = + 0.5J',...
'Parent',axes1,...
'FaceColor',[0.749019622802734 0.749019622802734 0]);
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
h = gcf; %current figure handle
axesObjs = get(h, 'Children'); %axes handles
dataObjs = get(axesObjs, 'Children'); %handles to low-level graphics objects in axes
%%get data
XX = dataObjs.XData ;
YY = dataObjs.YData ;
ZZ = dataObjs.ZData ;
I am getting the following error: Struct contents reference from a non-struct array object.
The plot is fine, but cannot extract any data.
The second part works normally with surface plots generated from non-syms generated plots.
Can you please help me understand? Is there any other way?
采纳的回答
更多回答(1 个)
类别
在 帮助中心 和 File Exchange 中查找有关 Calculus 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!


