paraview导出数据,再使用octave进行处理,一直报错:
octave: X11 DISPLAY environment variable not set octave: disabling GUI features error: load: failed to read matrix from file 'uz_030.csv' error: called from postproc-wake_velocity.m at line 8 column 5
先看一下octave的代码,好像问题不大
% postproc-MATLAB.m: just post-processing clear; clc; close all; % read data from simulation par1=load('-ascii','uz_030.csv'); par2=load('-ascii','uz_100.csv'); D=300/1000; %%%%管道直径 D1=0.01588; D2=1.0 * D1; %%%%注意修改 Dn=D1/2 + D2/2; rhoS1=7800; rhoS2=1.0 * rhoS1; %%%%注意修改 rhoS=rhoS1*(D1*D1*D1/(D1*D1*D1+D2*D2*D2))+rhoS2*(D2*D2*D2/(D1*D1*D1+D2*D2*D2)); rhoF=1260; gravity=9.81; uc=((rhoS/rhoF-1)*gravity*Dn)^0.5; tc=Dn/uc; x=par1(:,4); uz_030=par1(:,3); uz_100=par2(:,3); x_star=x/Dn; uz_030_star=uz_030/uc; uz_100_star=uz_100/uc; M=[x_star uz_030_star uz_100_star]; [m,n]=size(M); fid = fopen('wake_velocity.txt','w'); for i=1:1:m for j=1:1:n fprintf(fid,'%g ',M(i,j)); end fprintf(fid,'\n'); end fclose(fid);
在看一下paraview导出的“.csv”数据的内容:
注意上面第一行里面,都带有了冒号“:”,将冒号删掉之后,octave运行正常。
因此在使用octave或者MATLAB对数据进行处理是,最好提前删掉数据文件中的符号,或者直接删除当前数据所在的行,比如:
, : - /
标签:uz,paraview,octave,030,csv,D2,D1 From: https://www.cnblogs.com/Xiwang-Sun/p/17792419.html