Discover MakerZone

MATLAB and Simulink resources for Arduino, LEGO, and Raspberry Pi

Learn more

Discover what MATLAB® can do for your career.

Opportunities for recent engineering grads.

Apply Today

Thread Subject:
how to extract matrix data from gui contour plot

Subject: how to extract matrix data from gui contour plot

From: Blake mei

Date: 3 Jun, 2010 16:33:04

Message: 1 of 3

I'm pretty new to Matlab.

I have this 2D gui contour map and I want to extract the data in the form of a matrix. Where is the data stored and how do i go about doing so?

Subject: how to extract matrix data from gui contour plot

From: Walter Roberson

Date: 3 Jun, 2010 18:54:27

Message: 2 of 3

Blake mei wrote:

> I have this 2D gui contour map and I want to extract the data in the
> form of a matrix. Where is the data stored and how do i go about doing so?

_Which_ data? The values that the contours were overlayed on, or the set of
contours?

get(ContourPlotHandle, 'ZData') %the Z values that were to be contoured



T = findall(ContourPlotHandle, 'Type', 'patch');
allX = get(T, 'XData');
allY = get(T, 'YData');
allZ = get(T, 'ZData');

allX{K}, allY{K} would then contain the X and Y coordinates of an individual
contour line, and allZ{K} would be the height of that contour.

Subject: how to extract matrix data from gui contour plot

From: roman voronov

Date: 11 Feb, 2013 02:50:15

Message: 3 of 3

allZ seems to be empty, when I do this... perhaps that only works for a 3d contour? would be nice to get this to work for a 2d contour

Walter Roberson <roberson@hushmail.com> wrote in message <hu8trl$ekv$1@canopus.cc.umanitoba.ca>...
> Blake mei wrote:
>
> > I have this 2D gui contour map and I want to extract the data in the
> > form of a matrix. Where is the data stored and how do i go about doing so?
>
> _Which_ data? The values that the contours were overlayed on, or the set of
> contours?
>
> get(ContourPlotHandle, 'ZData') %the Z values that were to be contoured
>
>
>
> T = findall(ContourPlotHandle, 'Type', 'patch');
> allX = get(T, 'XData');
> allY = get(T, 'YData');
> allZ = get(T, 'ZData');
>
> allX{K}, allY{K} would then contain the X and Y coordinates of an individual
> contour line, and allZ{K} would be the height of that contour.

Tags for this Thread

What are tags?

A tag is like a keyword or category label associated with each thread. Tags make it easier for you to find threads of interest.

Anyone can tag a thread. Tags are public and visible to everyone.

Contact us