Plotting Reaction Spectra over Time

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)

 Risposta accettata

Star Strider
Star Strider il 27 Apr 2019
Modificato: Star Strider il 27 Apr 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 Commenti

Dillon Wright
Dillon Wright il 27 Apr 2019
Modificato: Dillon Wright il 27 Apr 2019
Thank you!
As always, my pleasure!

Accedi per commentare.

Più risposte (0)

Categorie

Scopri di più su Physics in Centro assistenza e File Exchange

Prodotti

Release

R2018b

Community Treasure Hunt

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

Start Hunting!

Translated by