How do I present my solutions?
1 view (last 30 days)
Show older comments
Aidan Shek on 22 Feb 2017
Commented: Jan on 22 Feb 2017
If for example I got a matrix of : A = [1;2;3;4] how do i get it into the form so that in the matlab console it displays for example
x_answer = 1
y_answer = 2
z_answer = 3
p_answer = 4
I often find that when I post simple approaches, people follow up with clever approaches, so I tend to want to comment my simple approaches :]
You could write a simple function,
fprintf('\nA = \n\n')
fprintf(' x_answer = %d\n',A(1))
fprintf(' y_answer = %d\n',A(2))
fprintf(' z_answer = %d\n',A(3))
fprintf(' p_answer = %d\n',A(4))
You can remove spacing and A = or adjust whatever else you'd like.
Hope this helps!
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!