Write several 1x101 vectors to table for Latex

2 ビュー (過去 30 日間)
fadams18
fadams18 2020 年 2 月 17 日
回答済み: fred ssemwogerere 2020 年 2 月 18 日
I have 2 variable each of which are 1x101 size
A = AS_V ; % AS_V is 1x101
B = NeNMF_V; % NeNMF_V is 1x101
T = table(A,B);
save('savefile.dat', 'T')
How can i write these 2 variables into a table. so that i can use the handles to plot a figure in Latex. I want to have like 2 columns with the values of the varables and 1 row that have the names.

採用された回答

fred  ssemwogerere
fred ssemwogerere 2020 年 2 月 18 日
Hello, this should do nicely:
A = AS_V'; % taking transpose to get a column vector of size 101x1
B = NeNMF_V';% taking transpose to get a column vector of size 101x1
Tbl=table(A,B,'VariableNames',{'A','B'});
% depending on if you are plotting A versus B or B versus A proceed to plot; (below assuming you are plotting A versus B)
figure;
hnd=plot(A,B);hnd.Parent.TickLabelInterpreter='latex'; % set tick labels to latex format
hnd.Parent.XLabel.String='vals A'; % x-label
hnd.Parent.XLabel.Interpreter='latex'; % set x-label to latex format
hnd.Parent.YLabel.String='vals B'; % y-label
hnd.Parent.YLabel.Interpreter='latex';

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeLaTeX についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by