CFD Online Discussion Forums

CFD Online Discussion Forums (http://www.cfd-online.com/Forums/)
-   CFX (http://www.cfd-online.com/Forums/cfx/)
-   -   import data from CFX-post to MATLAB/EXCEL (http://www.cfd-online.com/Forums/cfx/23856-import-data-cfx-post-matlab-excel.html)

dhaval April 15, 2007 09:42

import data from CFX-post to MATLAB/EXCEL
 
hi, can u give the procedure to import the data from CFX-post to MATLAB/EXCEL to plot the graph & do the calculation.

Sze Hong April 15, 2007 12:47

Re: import data from CFX-post to MATLAB/EXCEL
 
Create a graph on the CFX post, and when you decide what you plotted, there is a button that says EXPORT.

Omer April 17, 2007 10:45

Re: import data from CFX-post to MATLAB/EXCEL
 
1. You can do it the way Sze Hong says, by plotting the chart and then exporting

2. Or once you have created your point/line of interest. Just press file ---> export--- in csv format, and you have it in EXCEL. ( You cannot export transient results this way though, i think)

Then if you want, you can import your values from excel to MATLAB easily.


Dhaval patel April 21, 2007 12:12

what is the procedure to find coefficient of lift
 
what is the procedure to find the coefficient of lift from velocity vs chord length graph? or pressure vs chord length graph?

Darren Leong April 28, 2011 02:48

Hi guys,

I need help on this too. I have transient run in which i would like Matlab to graph the location of a moving body (X,Y,Z), along with the forces and moments acting on it. So far, I've set up the monitor plots in which the data is stored in *.out files for each time step.

The data sitting in front of me on screen, however I haven't the clue to how to graph them out using Matlab, e.g. Collating them into one data file for plotting or reading the values from each .out file as it plots the graph.

Edit: Just to clarify what i mean is through script rather than manually (e.g. using the mouse) in Matlab.

Kartus May 24, 2011 05:26

I use the export function to export the results in a .csv file. You have to set a location from which it exports the results, so it is always recommended to view the results first in a chart and then export them to a .csv file. Make sure you don't add the header, you can unselect it on the second tab of the export screen, otherwise you have to manually set the rows and columns of the data for Matlab to work.

Use csvread in Matlab to load the results in your workspace. You can check 'help csvread' on how to do that.

Cheers!

Darren Leong May 26, 2011 00:39

Thanks, Kartus. I've managed to do as you've suggested

Results_002 = csvread ('Analysis_Results_002.dat',1,0);


It would have been good to have the labels read, would save me time to manually include them in the plot, e.g.

Timestep = Results_001(:,1);
Mesh_Quality = Results_001(:,2);
Sphere1_Force_X = Results_001(:,3);
Sphere1_Force_Y = Results_001(:,4);
Sphere1_Force_Z = Results_001(:,5);
Sphere1_Moment_K = Results_001(:,6);
Sphere1_Moment_M = Results_001(:,7);... and so on

Kartus May 26, 2011 05:01

To my knowledge it is not possible to read anyhting else then values from a csv file using csvread.

I can't help you with the labels, I add all the labels manually in an m-file and load all the results for different cases from that file. It is a copy-paste solution, not very elegant...

amin_gls March 4, 2013 10:29

hello. i have a question about this . when i export to .csv file and opens it with excel . the data are in different rows and just one column .for example x1 and v1 are in first column i want to be x1 in fist and v1 in second column . how can i do it . thanks for help .:(:confused:

Lance March 4, 2013 11:02

This is really not a CFX issue, but here goes...

It would be something like:
Data/From text/<find your file>/Delimited/<next>/Delimiters: comma/<finish>

amin_gls March 5, 2013 03:28

Quote:

Originally Posted by Lance (Post 411367)
This is really not a CFX issue, but here goes...

It would be something like:
Data/From text/<find your file>/Delimited/<next>/Delimiters: comma/<finish>


thank you .. i did it .


All times are GMT -4. The time now is 02:54.