CFD Online Discussion Forums

CFD Online Discussion Forums (http://www.cfd-online.com/Forums/)
-   Main CFD Forum (http://www.cfd-online.com/Forums/main/)
-   -   Importing FLUENT .srp files into MATLAB (http://www.cfd-online.com/Forums/main/91349-importing-fluent-srp-files-into-matlab.html)

CAD-AL August 8, 2011 08:41

Importing FLUENT .srp files into MATLAB
 
I am trying to import multiple .srp files (an example of the file is shown below) into FLUENT using a script. I need the numerical values from the .srp files to be imported into a table (similar to an EXCEL spreadsheet) that I can then use to create plots in MATLAB. I would also like to include the files names in the first row of the table if possible.

I have started the code to try to do this, but I am not sure how to take the information from the cell arrays and combine them all into one table. Please help :)

"Surface Integral Report"

Area-Weighted Average
Total Pressure (pascal)
-------------------------------- --------------------
entree 3.7032218
sortie-dl -0.38038716
sortie-dr -1.0349007
transform-par 2.030206
transform-dl 0.8842029
transform-dr 1.3729798
---------------- --------------------
Net 1.6737195

Sample code:
%MATLAB CODE TO ANALYZE DATA OBTAINED FROM FLUENT
fnames=dir('folder/*.srp')
numfids=length(fnames)

%TO PUT FILENAMES IN THE FIRST ROW
q=cell(1,numfids)
for k=1:numfids
q{k}=fnames{k}.name
end


%TO ENTER FLUENT DATA
g=cell(1,numfids)
for p=1:numfids
g{p}=importdata(q{1,p},' ',5)
end

%TO PUT DATA INTO COLUMNS
h=cell(1,numfids)
for c=1:numfids
h{c}=g{1,c}.data
end

%TO COMBINE THE TWO CELL ARRAYS
a=cell(1,numfids)
for d=1:numfids
a{d}={[q{d}];[h{d}]}
end


All times are GMT -4. The time now is 19:10.