Write several 1x101 vectors to table for Latex

조회 수: 1 (최근 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 CenterFile Exchange에서 LaTeX에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by