CFD Online Logo CFD Online URL
www.cfd-online.com
[Sponsors]
Home > Forums > General Forums > Main CFD Forum

Problem with extracting data from contour in matlab

Register Blogs Community New Posts Updated Threads Search

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   August 5, 2015, 16:45
Default Problem with extracting data from contour in matlab
  #1
Member
 
Mihir Makwana
Join Date: May 2015
Posts: 79
Rep Power: 11
mihirmakwana6 is on a distinguished road
I have plotted temperature field on a square domain with 80X80 grid points using a contour command in MATLAB

contourf(xp,zp,T_new,25);

where xp,zp : co-ordinates
T_new : Temperature of which contour is to be plotted

I have a " .fig " file of the contour.

I want to get the temperature values at all the 80X80 points in the form of a matrix using this " .fig " file . Can anyone please tell me the syntax to extract the data ?

I searched various forums but I am not able to get the solution to this.

Please help.

Thanks in advance.

-Mihir
mihirmakwana6 is offline   Reply With Quote

Old   August 5, 2015, 17:37
Default
  #2
Senior Member
 
Filippo Maria Denaro
Join Date: Jul 2010
Posts: 6,896
Rep Power: 73
FMDenaro has a spectacular aura aboutFMDenaro has a spectacular aura aboutFMDenaro has a spectacular aura about
Quote:
Originally Posted by mihirmakwana6 View Post
I have plotted temperature field on a square domain with 80X80 grid points using a contour command in MATLAB

contourf(xp,zp,T_new,25);

where xp,zp : co-ordinates
T_new : Temperature of which contour is to be plotted

I have a " .fig " file of the contour.

I want to get the temperature values at all the 80X80 points in the form of a matrix using this " .fig " file . Can anyone please tell me the syntax to extract the data ?

I searched various forums but I am not able to get the solution to this.

Please help.

Thanks in advance.

-Mihir

I am not sure to understand your question ... the variable T_new should already be a 80x80 matrix ...thus, you have all values you want
FMDenaro is offline   Reply With Quote

Old   August 5, 2015, 18:09
Default
  #3
Member
 
Mihir Makwana
Join Date: May 2015
Posts: 79
Rep Power: 11
mihirmakwana6 is on a distinguished road
Quote:
Originally Posted by FMDenaro View Post
I am not sure to understand your question ... the variable T_new should already be a 80x80 matrix ...thus, you have all values you want
Sir, I only have the .fig file which is the contour plot for Temperature and I have no other data.

T_new is 80X80 matrix : This I know as I had taken the no. of grid points in both directions as 80

I just need the syntax to extract the 80X80 matrix from the .fig file .

- Mihir
mihirmakwana6 is offline   Reply With Quote

Old   August 5, 2015, 18:18
Default
  #4
Senior Member
 
Filippo Maria Denaro
Join Date: Jul 2010
Posts: 6,896
Rep Power: 73
FMDenaro has a spectacular aura aboutFMDenaro has a spectacular aura aboutFMDenaro has a spectacular aura about
Quote:
Originally Posted by mihirmakwana6 View Post
I have plotted temperature field on a square domain with 80X80 grid points using a contour command in MATLAB

contourf(xp,zp,T_new,25);
But You wrote to have used contourf which works on a matrix....
FMDenaro is offline   Reply With Quote

Old   August 5, 2015, 18:22
Default
  #5
Member
 
Mihir Makwana
Join Date: May 2015
Posts: 79
Rep Power: 11
mihirmakwana6 is on a distinguished road
Quote:
Originally Posted by FMDenaro View Post
But You wrote to have used contourf which works on a matrix....
Sir, after using the contour command , I saved the plot and closed matlab. So now I don't have the temperature matrix . I just have that saved .fig file with me
mihirmakwana6 is offline   Reply With Quote

Old   August 5, 2015, 18:39
Default
  #6
Member
 
Alex
Join Date: Jan 2014
Posts: 54
Rep Power: 12
H0T_S0UP is on a distinguished road
You really cant figure this out and you are a PhD student?


I was going to write about using fopen and creating a filestream, but matlab has a quick command to do this:

http://www.mathworks.com/help/matlab/ref/dlmwrite.html

The .fig file contains information about the figure only.
H0T_S0UP is offline   Reply With Quote

Old   August 5, 2015, 18:43
Default
  #7
Senior Member
 
Filippo Maria Denaro
Join Date: Jul 2010
Posts: 6,896
Rep Power: 73
FMDenaro has a spectacular aura aboutFMDenaro has a spectacular aura aboutFMDenaro has a spectacular aura about
Quote:
Originally Posted by mihirmakwana6 View Post
Sir, after using the contour command , I saved the plot and closed matlab. So now I don't have the temperature matrix . I just have that saved .fig file with me
Have a look here

https://www.mathworks.com/matlabcent..._thread/249507

But I still believe you have to work on the original matrix instead of using this method....rum again the code and write the Matrix on a file to manage after.
FMDenaro is offline   Reply With Quote

Reply


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Moving boundary problem based on calculated data sandro.grm OpenFOAM Programming & Development 53 October 11, 2024 09:50
How to assign the inlet B.C using a bunch of data set for an unsteady problem? ali8500 CFX 3 March 28, 2012 19:41
[OpenFOAM] How to create an contour plot for arbitrary plane with interpolated data navaladi ParaView 0 June 4, 2008 08:57
Exporting data to MATLAB Ryan FLUENT 2 July 12, 2006 07:41
How to update polyPatchbs localPoints liu OpenFOAM Running, Solving & CFD 6 December 30, 2005 18:27


All times are GMT -4. The time now is 18:23.