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:
3D plot

Subject: 3D plot

From: Jasmine

Date: 19 Jun, 2010 15:00:22

Message: 1 of 4

Hi. This will probably sound mundane but how do I plot a 3D graph with data imported from excel?
I have only recently started using MatLab and do not have much knowledge about it apart from some very basic usage.
I imported the data and separated them into data1, data2 and data3, without using xlsread though.
They are under my Workspace.
From there, I tried coding in a script and run it.

Let's say data1=x, data2=y, data3=z
I tried a few from the internet and the current 1 I am trying like this does not work.

[x,y]=meshgrid(data1(1:end),data2(1:end));
z=data3(1:end,1:end);
surf(x,y,z);

Truth to be told I still do not understand what to enter properly for this section (data(?,:?) or (data(?:?). I take it that it works like excel (but I still get myself confused over it).

Is there any other methods for 3D plotting?
Any advices?
Thanks in advance.

Subject: 3D plot

From: us

Date: 19 Jun, 2010 15:57:05

Message: 2 of 4

"Jasmine " <j.akabane@gmail.com> wrote in message <hvim26$t3r$1@fred.mathworks.com>...
> Hi. This will probably sound mundane but how do I plot a 3D graph with data imported from excel?
> I have only recently started using MatLab and do not have much knowledge about it apart from some very basic usage.
> I imported the data and separated them into data1, data2 and data3, without using xlsread though.
> They are under my Workspace.
> From there, I tried coding in a script and run it.
>
> Let's say data1=x, data2=y, data3=z
> I tried a few from the internet and the current 1 I am trying like this does not work.
>
> [x,y]=meshgrid(data1(1:end),data2(1:end));
> z=data3(1:end,1:end);
> surf(x,y,z);
>
> Truth to be told I still do not understand what to enter properly for this section (data(?,:?) or (data(?:?). I take it that it works like excel (but I still get myself confused over it).
>
> Is there any other methods for 3D plotting?
> Any advices?
> Thanks in advance.

a hint:

     help plot3;
     help line;

us

Subject: 3D plot

From: Gang-Gyoo

Date: 20 Jun, 2010 11:23:05

Message: 3 of 4

Hi

not easy to say something without any information about your data storaged.
But, this code may help you.

% use this with proper row and column numbers
x= reshape(data1,6,4); % for an example, row is 6 and column 4
y= reshape(data2,6,4);
z= reshape(data3,6,4);
surf(x,y,z)

Subject: 3D plot

From: Christopher Rouxel

Date: 12 Aug, 2010 15:51:06

Message: 4 of 4

Hey Jasmine,
try this GUI:
http://www.mathworks.com/matlabcentral/fileexchange/28177-3d-performance-map-gui
-Chris

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