How to Display Data in Table
521 views (last 30 days)
Show older comments
I wanted to ask how it would be possible to display the data of an exteriment into a table. For instance, If I am doing 11 trials, starting from 0 and rising to 50 in incraments of 5, how would I be able to display data in a table? I understand that it would be possible to format everything into an array and enter all values manually , but is it possible to display results directly as a table (for instance, if I wanted to up the trials from 11 to 100, so I wouldnt have to enter all values manually)
The code I'm working with is:
v = 0:5:50
a_n=(-0.01.*(v+50))./(exp(-(v+50)./10)-1)
b_n= exp(-(v+60)./80)./8
a_m = (-.1.*(v+35))./(exp(-(v+35)./10)-1)
b_m = 4.*exp(-(v+60)./18)
a_h = .07.*exp(-(v+60)./20)
b_h = 1./(exp(-(v+30)./10)+1)
but I want to display the results as a neatly organized table rather than a general output, especially if I want to change the start/endpoint or intervals.
0 Comments
Accepted Answer
Chunru
on 12 Dec 2021
Edited: Chunru
on 4 Dec 2023
v = (0:5:50)'; % use a column here
a_n=(-0.01.*(v+50))./(exp(-(v+50)./10)-1);
b_n= exp(-(v+60)./80)./8;
a_m = (-.1.*(v+35))./(exp(-(v+35)./10)-1);
b_m = 4.*exp(-(v+60)./18);
a_h = .07.*exp(-(v+60)./20);
b_h = 1./(exp(-(v+30)./10)+1);
% For same size data here, you can organize them into a table
T = table(v, a_n, b_n, a_m, a_h, b_h)
% if you want to show part of the data
T(4:7, :)
% To display table with specific format:
% Round it and save to a new variable
T1 = varfun(@(x)(round(x, 2)), T)
3 Comments
More Answers (0)
See Also
Categories
Find more on Genomics and Next Generation Sequencing in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!