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?

 Réponse acceptée

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 commentaires

Yash
Yash le 7 Juil 2016
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?
Yash
Yash le 7 Juil 2016
I have attached the image of the structure and the variables inside the structure

Connectez-vous pour commenter.

Plus de réponses (0)

Catégories

Community Treasure Hunt

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

Start Hunting!

Translated by