How to plot row data from a matlab table -
if have results @ 2 rows
methode1 m2 m3 m4 data1 .456 .567 .987 .654 data2 .768 .654 .546 .231
and want draw each line separately 2 lines on same scale
from way present data i'm assuming you're dealing matlab table this:
>> methode1 = [.456; .768]; m2 = [.567; .654]; m3 = [.987; .546]; m4 = [.654; .231]; >> t = table(methode1, m2, m3, m4, 'rownames', {'data1', 'data2'}) t = methode1 m2 m3 m4 ________ _____ _____ _____ data1 0.456 0.567 0.987 0.654 data2 0.768 0.654 0.546 0.231
and actual question you're not sure how plot because t('data1', :)
produces table opposed numbers, , therefore plot(t('data1', :))
doesn't work, rather because you're not aware of plot
command (if aren't aware of plot
command, read online, you'll find lots of explanatory examples).
to use data, need extract array first. command is:
>> t_data = table2array(t) t_data = 0.4560 0.5670 0.9870 0.6540 0.7680 0.6540 0.5460 0.2310
you can plot normal array, e.g.
>> plot(t_data(1,:), 'ro-'); >> hold on >> plot(t_data(2,:), 'gd--'); >> hold off
the hold
command allows have more 1 plots on same figure window.
Comments
Post a Comment