Genarating 3d Plot from a struct exported matfile

Hello,
I generated a struct file from a project with three variables and exported it into a matfile. Now i need to generate a 3D plot for the three variables from the exported struct containing matfile. Can some one help with this?

 Accepted Answer

If file.mat is your mat-file
data=load('file.mat')
n=fieldnames(data)
x=data.(n{1})
y=data.(n{2})
z=data.(n{3})
plot3(x,y,z)

3 Comments

Getting an error Index exceeds matrix dimensions. table1: [16x21 struct] --> struct size y=data.(n{2}), y=data.(n{3})--> These lines getting error
Can you provide more details about your three variables?
I have attached the image of the structure and the variables inside the structure

Sign in to comment.

More Answers (0)

Asked:

on 7 Jul 2016

Commented:

on 7 Jul 2016

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!