Switching a row vector to a column vector

I am having trouble switching a row vector to a column vector using fprintf. However, when I enter the variable that has the vector into the command window, it displays a column. But when I try to output that same variable using fprintf, it shows up as a column. I have another vector that I am trying to add it beside, because I am creating a table. I can't seem to do this however, because the vector will not flip. This is my output so far:
The bottom row of numbers is what I am trying to make a column and put it under "F" in the table. (The row goes on longer, I didn't screencap it all because it would have made the numbers too small in the image).
I have tried using the ' to flip the vector, but with no avail.
Thanks!

回答(1 个)

Hi,
output using fprintf needs always to be done row wise, not column wise. So build up your data e.g. into a cell matrix and print it then using fprintf ...
Titus

4 个评论

But what I don't understand is that I used fprintf for that first column that you see in the image, and it worked just fine. Why is the second column any different?
Thanks for your help.
can you paste in the section of code?
It's the third fprintf statement that's giving me the row when the second is outputting a column. When I add a \n to the third fprintf statement, it produces the column, but it is a line lower than I want it to be. Can I not put two vectors right next to each other like I am trying to? (When I input F and C into the command window, both give me columns).
Thanks
never mind guys, I figured it out. Thank you for your help!

请先登录,再进行评论。

类别

帮助中心File Exchange 中查找有关 Logical 的更多信息

产品

标签

提问:

2014-3-25

评论:

2014-3-25

Community Treasure Hunt

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

Start Hunting!

Translated by