Why doesn't my matrix appear without missing columns
1 次查看(过去 30 天)
显示 更早的评论
The matrices outputs come out wrong. Eg. I create a 3x3 matrix, but the output shows only 2 columns. I am trying to make teaching documents, but these errors keep me from doing so.
17 个评论
Raj
2020-1-14
"I create a 3x3 matrix, but the output shows only 2 columns" - There is no logical reason for this to happen. We can't help unless you show your process and data!
Christopher Winfield
2020-1-14
It happens after I use 'format rat'. The correct size of the matrix is displayed but the last column is removed.
Christopher Winfield
2020-1-14
I allowed the updates but the problem persists - even after I remove 'format rat'
Christopher Winfield
2020-1-14
编辑:per isakson
2020-1-15
Try it using format rat. Someone else in our department was able to reproduce this. It presents as a clickalbe output, presenting the dimensions of the output, but not the whole output.
Adam Danz
2020-1-14
format doesn't change the size of a variable.
format rat
A=[1,2;3, 4]
size(A) % = [2,2]
"Someone else in our department was able to reproduce this."
Perhaps there's some action being taken on the matrix but I can tell you that the matrix in your quesiton (A) is a 2x2 matix and will never be a 3x3 matrix under any format.
Image Analyst
2020-1-15
Your screenshot shows you creating a 2x2 matrix with one column showing, NOT a 3x3 matrix with 2 columns showing as you said.
Anyway, I get exactly what is expected.
Are you sure that you didn't create A by stitching together some column vectors with one being null, as Walter suggested?
Christopher Winfield
2020-1-15
Wow. Maybe that was another example. I hope that doesn't disqualify me for addressing my problem. OMG
Adam Danz
2020-1-15
编辑:Adam Danz
2020-1-15
You can see in your screen shot that A is 3x3.
Here's the output when I run that code,
However, when I resize the command window to make it narrow, I can make it appear as if A only has 2 columns (nothing changed between these 2 screen shots other than resizing the command window).
Your command window has plenty of space to the right of the 2nd column shown in your screenshot but you may want to double check that this isn't causing the issue.
采纳的回答
更多回答(1 个)
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Logical 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!发生错误
由于页面发生更改,无法完成操作。请重新加载页面以查看其更新后的状态。
您也可以从以下列表中选择网站:
如何获得最佳网站性能
选择中国网站(中文或英文)以获得最佳网站性能。其他 MathWorks 国家/地区网站并未针对您所在位置的访问进行优化。
美洲
- América Latina (Español)
- Canada (English)
- United States (English)
欧洲
- Belgium (English)
- Denmark (English)
- Deutschland (Deutsch)
- España (Español)
- Finland (English)
- France (Français)
- Ireland (English)
- Italia (Italiano)
- Luxembourg (English)
- Netherlands (English)
- Norway (English)
- Österreich (Deutsch)
- Portugal (English)
- Sweden (English)
- Switzerland
- United Kingdom (English)
亚太
- Australia (English)
- India (English)
- New Zealand (English)
- 中国
- 日本Japanese (日本語)
- 한국Korean (한국어)