Accessing huge matrix of symfun?

I have this H.mat file with an H variable that is of type symfun. Its supposed to be a matrix with symbolic variables:
syms s
H(s) = C/(s*eye(size(A))-A)
and matrices C and A also contian multiple and many other symbolic variables. But when I got H (which I attached in the .mat file here), I cannot see its contents from the workspace (I believe its because its too big and complicated). So how can I index/call or get access in any other way to whats inside H?
Note: A is 12 by 12 and C is 6 by 12.

5 comentarios

Dyuman Joshi
Dyuman Joshi el 27 de Jul. de 2023
Please attach the files for A and C.
It appears that we can not load the file H.mat as the symengine was reset, and MATLAB is asking repeat commands to regenarate the result.
Ali Almakhmari
Ali Almakhmari el 27 de Jul. de 2023
Editada: Ali Almakhmari el 27 de Jul. de 2023
Sure! Here is my full code:
%The Symbolic Variables
syms ksm ksn ksl wsm wsn wsl Delsm Delsn Delsl DelT m Delgx Delgy Delgz dx
syms tilda_Xu ro tilda_Xv qo tilda_Xw tilda_Xp wo tilda_Xq vo tilda_Xr tilda_Yu tilda_Yv po tilda_Yw uo tilda_Yp tilda_Yq tilda_Yr tilda_Zu tilda_Zv tilda_Zw tilda_Zp tilda_Zq tilda_Zr tilda_Lu tilda_Lv tilda_Lw tilda_Lp tilda_Ixx tilda_Lq tilda_Lr tilda_Mu tilda_Mv tilda_Mw tilda_Iyy tilda_Mp tilda_Mq tilda_Mr tilda_Nu tilda_Nv tilda_Nw tilda_Np tilda_Nq tilda_Nr tilda_Izz
syms tilda_X_delm tilda_X_deln tilda_X_dell tilda_Y_delm tilda_Y_deln tilda_Y_dell tilda_Z_delm tilda_Z_deln tilda_Z_dell tilda_L_delm tilda_L_deln tilda_L_dell tilda_M_delm tilda_M_deln tilda_M_dell tilda_N_delm tilda_N_deln tilda_N_dell mu_sm mu_sn mu_sl
% Defining A Matrix
F =[tilda_Xu, (ro+tilda_Xv) (-qo+tilda_Xw) tilda_Xp (-wo+tilda_Xq) (vo+tilda_Xr); (-ro+tilda_Yu) tilda_Yv (po+tilda_Yw) (wo+tilda_Yp) tilda_Yq (-uo+tilda_Yr); (qo+tilda_Zu) (-po+tilda_Zv) tilda_Zw (-vo+tilda_Zp) (uo+tilda_Zq) tilda_Zr; tilda_Lu tilda_Lv tilda_Lw tilda_Lp (tilda_Ixx*ro + tilda_Lq) (tilda_Ixx*qo + tilda_Lr); tilda_Mu tilda_Mv tilda_Mw (tilda_Iyy*ro + tilda_Mp) tilda_Mq (tilda_Iyy*po + tilda_Mr); tilda_Nu tilda_Nv tilda_Nw (tilda_Izz*qo + tilda_Np) (tilda_Izz*po + tilda_Nq) tilda_Nr];
G = [tilda_X_delm tilda_X_deln tilda_X_dell; tilda_Y_delm tilda_Y_deln tilda_Y_dell; tilda_Z_delm tilda_Z_deln tilda_Z_dell; tilda_L_delm tilda_L_deln tilda_L_dell; tilda_M_delm tilda_M_deln tilda_M_dell; tilda_N_delm tilda_N_deln tilda_N_dell];
A = [F, G, zeros(6,3);zeros(3,6),zeros(3,3),eye(3);zeros(3,6), [-wsm^2,0,0;0,-wsn^2,0;0,0,-wsl^2], [-2*mu_sm*wsm,0,0;0,-2*mu_sn*wsn,0;0,0,-2*mu_sl*wsl]]; %The A matrix
% Defining C Matrix
HH = [0,0,0,1,0,0;0,0,0,0,1,0;0,0,0,0,0,1;tilda_Xu,tilda_Xv,tilda_Xw,tilda_Xp,(tilda_Xq-2*qo*dx) (tilda_Xr-2*ro*dx); (tilda_Yu+tilda_Nu*dx) (tilda_Yv+tilda_Nv*dx) (tilda_Yw+tilda_Nw*dx) (tilda_Yp+(qo+tilda_Izz*qo+tilda_Np)*dx) (tilda_Yq+(po+tilda_Izz*po+tilda_Nq)*dx) (tilda_Yr+tilda_Nr*dx); (tilda_Zu-tilda_Mu*dx) (tilda_Zv-tilda_Mv*dx) (tilda_Zw-tilda_Mw*dx) (tilda_Zp+(ro-tilda_Iyy*ro-tilda_Mp)*dx) (tilda_Zq-tilda_Mq*dx) (tilda_Zr+(po-tilda_Iyy*po+tilda_Mr)*dx)];
J = [0 0 0; 0 0 0; 0 0 0; tilda_X_delm tilda_X_deln tilda_X_dell; (tilda_Y_delm+tilda_N_delm*dx) (tilda_Y_deln+tilda_N_deln*dx) (tilda_Y_dell+tilda_N_dell*dx); (tilda_Z_delm-tilda_M_delm*dx) (tilda_Z_deln-tilda_M_deln*dx) (tilda_Z_dell-tilda_M_dell*dx)];
C = [HH J zeros(6,3)]; %The C matrix
%Finding H
syms s
H(s) = C/(s*eye(size(A))-A)
Mann Baidi
Mann Baidi el 17 de Ag. de 2023
Hi Ali,
How does the variable in H in 'H.mat' is of size 1x1?
Ali Almakhmari
Ali Almakhmari el 17 de Ag. de 2023
Editada: Ali Almakhmari el 17 de Ag. de 2023
Its a 1 by 1 symFcn but when you open it you will get a matrix with multiple symFcn equations. The issue is that I cannot index that H to extract a specific symFcn equation in the matrix. For example, having H, how can I extract the symFcn in the 1st row, 2nd column?
Mann Baidi
Mann Baidi el 18 de Ag. de 2023
You will not be able to extract it untill the matrix is mxn matrix and not 1x1 matrix.

Respuestas (0)

La pregunta está cerrada.

Productos

Versión

R2022b

Preguntada:

el 27 de Jul. de 2023

Cerrada:

el 18 de Ag. de 2023

Community Treasure Hunt

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

Start Hunting!

Translated by