You are now following this question
- You will see updates in your followed content feed.
- You may receive emails, depending on your communication preferences.
Why doesn't my matrix appear without missing columns
3 views (last 30 days)
Show older comments
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 Comments
Raj
on 14 Jan 2020
"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
on 14 Jan 2020
It happens after I use 'format rat'. The correct size of the matrix is displayed but the last column is removed.
Christopher Winfield
on 14 Jan 2020
I allowed the updates but the problem persists - even after I remove 'format rat'
Christopher Winfield
on 14 Jan 2020
This occurs when I am creating an .mlx file through LIVE EDITOR.
Christopher Winfield
on 14 Jan 2020
Edited: per isakson
on 15 Jan 2020
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
on 14 Jan 2020
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
on 15 Jan 2020
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
on 15 Jan 2020
Wow. Maybe that was another example. I hope that doesn't disqualify me for addressing my problem. OMG
Adam Danz
on 15 Jan 2020
Edited: Adam Danz
on 15 Jan 2020
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.
Accepted Answer
More Answers (1)
See Also
Categories
Find more on Logical in Help Center and File Exchange
Tags
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!An Error Occurred
Unable to complete the action because of changes made to the page. Reload the page to see its updated state.
Select a Web Site
Choose a web site to get translated content where available and see local events and offers. Based on your location, we recommend that you select: .
You can also select a web site from the following list
How to Get Best Site Performance
Select the China site (in Chinese or English) for best site performance. Other MathWorks country sites are not optimized for visits from your location.
Americas
- América Latina (Español)
- Canada (English)
- United States (English)
Europe
- 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)
Asia Pacific
- Australia (English)
- India (English)
- New Zealand (English)
- 中国
- 日本Japanese (日本語)
- 한국Korean (한국어)