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)

 Accepted Answer

Star Strider
Star Strider on 27 Apr 2019
Edited: Star Strider on 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

More Answers (0)

Categories

Find more on Physics in Help Center and File Exchange

Products

Release

R2018b

Community Treasure Hunt

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

Start Hunting!