CFD Online Discussion Forums

CFD Online Discussion Forums (https://www.cfd-online.com/Forums/)
-   Main CFD Forum (https://www.cfd-online.com/Forums/main/)
-   -   Problem with extracting data from contour in matlab (https://www.cfd-online.com/Forums/main/157711-problem-extracting-data-contour-matlab.html)

mihirmakwana6 August 5, 2015 15:45

Problem with extracting data from contour in matlab
 
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

FMDenaro August 5, 2015 16:37

Quote:

Originally Posted by mihirmakwana6 (Post 558495)
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

mihirmakwana6 August 5, 2015 17:09

Quote:

Originally Posted by FMDenaro (Post 558500)
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

FMDenaro August 5, 2015 17:18

Quote:

Originally Posted by mihirmakwana6 (Post 558495)
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....

mihirmakwana6 August 5, 2015 17:22

Quote:

Originally Posted by FMDenaro (Post 558505)
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

H0T_S0UP August 5, 2015 17:39

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.

FMDenaro August 5, 2015 17:43

Quote:

Originally Posted by mihirmakwana6 (Post 558506)
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.


All times are GMT -4. The time now is 06:16.