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?

 Risposta accettata

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 Commenti

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

Accedi per commentare.

Più risposte (0)

Community Treasure Hunt

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

Start Hunting!

Translated by