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)

 採用された回答

Star Strider
Star Strider 2019 年 4 月 27 日
編集済み: Star Strider 2019 年 4 月 27 日

0 投票

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 件のコメント

Dillon Wright
Dillon Wright 2019 年 4 月 27 日
編集済み: Dillon Wright 2019 年 4 月 27 日
Thank you!
Star Strider
Star Strider 2019 年 4 月 27 日
As always, my pleasure!

サインインしてコメントする。

その他の回答 (0 件)

カテゴリ

ヘルプ センター および File Exchange で Physics についてさらに検索

製品

リリース

R2018b

Community Treasure Hunt

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

Start Hunting!

Translated by