I have the following code in MATLAB:
clear;clc;
k=load('OUTPUT_sub_1_stiffness.txt');
m=load('OUTPUT_sub_1_mass.txt');
[v_default,d_default]=eig(k,m);
v_kai=load('Eigenvector.txt');
d_kai=load('Eigenvalue.txt');
[v_qz,d_qz]=eig(k,m,'qz');
[v_chol,d_chol]=eig(k,m,'chol');
save('v_default.txt','v_default','-ascii');
save('d_default.txt','d_default','-ascii');
save('v_kai.txt','v_kai','-ascii');
save('d_kai.txt','d_kai','-ascii');
save('v_qz.txt','v_qz','-ascii');
save('d_qz.txt','d_qz','-ascii');
save('v_chol.txt','v_chol','-ascii');
save('d_chol.txt','d_chol','-ascii');
All the variable which start with v
like v_qz
are saved correctly as text files as shown below:
However, to my surprise, all the variable which start with d
like d_qz
can not be saved correctly, as shown below:
I wonder if anybody knows why.
I figured it out: just added this option
'-double'
and it got corrected, like below: