How do I present my solutions?
1 次查看(过去 30 天)
显示 更早的评论
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
3 个评论
John Chilleri
2017-2-22
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 :]
回答(1 个)
John Chilleri
2017-2-22
Hello,
You could write a simple function,
function printToAidanSheksDesires(A)
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))
end
You can remove spacing and A = or adjust whatever else you'd like.
Hope this helps!
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Genomics and Next Generation Sequencing 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!