I have imported a series of x,y data in a table that vary over time that visualizes a reaction using spectroscopic data. I would like to plot these x,y data in a 3D figure with respect to time, which is labelled as zvalue within the spectra tree of the variable "Specdata" in the attached file. I am also unable to plot all of the x,y data as a group in a 2D figure, but have been able to achieve a single spectra plot using :
plot (Specdata.spectra(x).xaxis, Specdata.spectra(x).data)

 Respuesta aceptada

Star Strider
Star Strider el 27 de Abr. de 2019
Editada: Star Strider el 27 de Abr. de 2019
Try this:
D = load('3D Spectra Plot.mat');
F = fieldnames(D.Specdata.spectra);
C = squeeze(struct2cell(D.Specdata.spectra));
x = cell2mat(C(4,:)');
y = cell2mat(C(5,:)');
z = cell2mat(C(1,:)');
zm = z * ones(1,size(x,2));
figure
plot3(x, y, zm)
grid on
xlabel(F{4})
ylabel(F{5})
zlabel(F{1})
view(135, 35)
Experiment to get the result you want.
Plotting Reaction Spectra over Time - 2019 04 27.png

2 comentarios

Dillon Wright
Dillon Wright el 27 de Abr. de 2019
Editada: Dillon Wright el 27 de Abr. de 2019
Thank you!
Star Strider
Star Strider el 27 de Abr. de 2019
As always, my pleasure!

Iniciar sesión para comentar.

Más respuestas (0)

Categorías

Más información sobre Physics en Centro de ayuda y File Exchange.

Productos

Versión

R2018b

Preguntada:

el 27 de Abr. de 2019

Comentada:

el 27 de Abr. de 2019

Community Treasure Hunt

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

Start Hunting!

Translated by