MATLAB Answers

MATLAB Answers Wish-list #5 (and bug reports)

114 views (last 30 days)
Rik
Rik on 3 Jul 2019
Answered: madhan ravi on 12 Oct 2020 at 20:48
This is the 5th installment of the wish-list and bug report thread.
This topic is the follow on to the first Wish-list for MATLAB Answer sections and second MATLAB Answers Wish-list #2 (and bug reports). The third started out as New design of the forum - grey on white and the fourth MATLAB Answers Wish-list #4 (and bug reports) is also growing so large it is slow to load and navigate.
Same idea as the previous ones: one wish (or bug report) per answer, so that people can vote their wishes.
What should you post where?
Wishlist threads (#1 #2 #3 #4 #5): bugs and feature requests for Matlab Answers
Frustation threads (#1 #2): frustations about usage and capabilities of Matlab itself
Missing feature threads (#1 #2): features that you whish Matlab would have had
@anyone posting a new thread when the last one gets too large (about 50 answers seems a reasonable limit per thread), please update this list in all last threads. (if you don't have editing privileges, just post a comment asking someone to do the edit)

  0 Comments

Sign in to comment.

Answers (35)

Adam
Adam on 26 Sep 2019
Edited: Adam on 26 Sep 2019
Has there been any further thought on changing what is considered a compulsory field for users asking a question? Title, body and tags appear to be still the only compulsory ones and some users are too lazy to put something intelligent in the tag field which allows you to type literally anything anyway.
Product is not compulsory and, as discussed previously, Release is locked until you select a product. This was the reason given last time I asked about this:
"With respect to the release drop-down being filtered, we do think this is important as it provides users with a smaller, pre-filtered list that is easier to use."
That was over a year ago and it still makes no more sense now than it did then given the reality. As another quick small sample, from the first page of questions just before I typed this, just 8 questions (excluding a Mathworks Tech Support team question) contained product information other than 'Matlab' (for which no releases would be filtered out anyway) and of those, just 5 contain the release. So not only is release locked until you enter the (optional) product, but it isn't compulsory even when you do enter the product. We're simply talking about a list of release numbers that a user has to select from. Having it almost useless just to make it 'easier to use' by filtering out a few releases is creating a 'solution' to a problem that didn't exist.
The release field seems fundamental to me and trivial to include properly. It clearly isn't working as it currently is because very few people fill in the release field. Surely the purpose of Matlab answers is to allow people to ask questions and get answers to them as smoothly as possible. So making it more difficult for the people answering the questions by not having release information just seems totally counter-intuitive. Obviously having the product compulsory for all questions would be a big help too, though again some users just put totally inappropriate products (Matlab Coder and Matlab compiler seem very popular!).

  5 Comments

Show 2 older comments
Guillaume
Guillaume on 26 Sep 2019
You get the same nuisance when you raise a bug through their web interface and it's just as annoying there.
I've suggested before to the developers to allow users to enter just a version number and if no product is select to default to matlab. I do think that version should be a compulsory field (with maybe a Not Applicable option for where it doesn't matter like this answer).
For what it's worth we (the CAB) have had several discussions with Mathworks on how to improve answers.
Sindar
Sindar on 21 Sep 2020 at 8:14
on the tag note: if requiring, can there at least be a character limit warning "this is a bit long for a tag, are you asking a question in a tag?"
Rik
Rik on 21 Sep 2020 at 8:44
And the release ambiguity struck again: I should have noticed that the screenshots in this question showed an unusually dark background, looking an awful lot like HG1. If the release was a compulsory field, a lot of back and forth (leading to the discovery that the release in question was R2013a) would have been avoided.

Sign in to comment.


Rik
Rik on 26 Nov 2019
Another nice-to-have feature: being able to move threads between the answer section and comments without having to repost them. One example of when it would be useful to only change the post type: this. In that thread there are 6 answers, each with some comments. I am not going to spend time finding out in what order they should be reposted, but if I could move the comment-answers (and their comments) to the comment section of one answer (or the question), that would solve the issue.
That thread is a relatively extreme example, but the problem of posting a comment in the answer section is a common occurence. I believe it has even been suggested that people should get a warning pop-up that they are about to post an answer to their own question (with the default option being 'post as comment').

  1 Comment

Guillaume
Guillaume on 25 Feb 2020
This is something that we've been bugging Mathworks about for a long time and I know they're very aware of the need for it. Of course, the implementation have to be balanced with the need of more important features.

Sign in to comment.


Adam Danz
Adam Danz on 28 Jan 2020
Spell check for questions / answers / comments
A spell check option would improve the quality of content, reduce misunderstandings, and reduce the need to edit our comments. The spell checker would ignore blocks of formatted code which could serve a second purpose of reminding people to format their code when their variable names are all detected as misspellings.
Browser extensions such as grammarly do not work in this forum even though they work in other forums.

  2 Comments

David
David on 28 Jan 2020
Thanks Adam, we are aware of this limitation, which is due to the way the wysiwyg editor works. While providing more functionality that the previous editor since it renders complex HTML behind the scenes it cannot take advantage of the default spellchecker(s) within most browsers. That being said, there are ways to get a spellchecker that we're actively looking into.
Adam Danz
Adam Danz on 28 Jan 2020
Thanks for the heads up, David.

Sign in to comment.


Sindar
Sindar on 6 May 2020
Add a set of pre-written comments for common situations. Things like:
  • "this is clearly a homework problem, please display some effort first"
  • "god your formatting is terrible, here's how to do better..."
  • "please give a minimal example, not 200 lines of code"
  • "Saying 'it errored' is entirely useless, be more specific"
  • "please go through the MATLAB onramp"
(The actual comment set should include complete instructions, and be slightly less hostile)
Having the ability to insert these comments would save us time, lead to friendlier interactions (we all get impatient), and give better info to questioners

  6 Comments

Show 3 older comments
Adam Danz
Adam Danz on 6 May 2020
I'd like to see these builtin templates as well.
Walter Roberson
Walter Roberson on 7 May 2020
I have a series of bookmarks in my browser menu bar that I copy out of the menu bar and paste in .
Rena Berman
Rena Berman on 12 May 2020
This is actually already in consideration. Thanks for all of your feedback!!

Sign in to comment.


madhan ravi
madhan ravi on 7 May 2020
There is a feature called "Managed Followed Content" , would like to see a feature to be able to "bookmark/pin" questions within MATLAB Answers.

  7 Comments

Show 4 older comments
Sindar
Sindar on 7 May 2020
Agreed, this would be very useful. I prefer keeping my bookmarks relatively sparse so autocomplete works well, but could see myself favoriting several items a week. (Once you've got this, can you add "REALLY Favorites" so I can filter to the stuff I know I'll be using for months-years to come?)
Adam Danz
Adam Danz on 7 May 2020
And then "Super Duper, Seriously, For-Real Favorites".
That highlights the limits of utility for the inevitable accumulation of pinned posts.
David
David on 11 May 2020
Thanks for the clarifications

Sign in to comment.


Mehmed Saad
Mehmed Saad on 10 Jul 2020
Edited: Mehmed Saad on 10 Jul 2020
Someone is Typing (Whistlist)
This feature can be very usefull not for the questioner but for contributors. For example
  1. Walter Roberson is typing a comment
  2. Image analyist is typing an Answer
Pros:it can save contributors time
Cons: Dont know xD
Like this or a popup for someone who is answering the question (that two contributors are typing the answer)

  6 Comments

Show 3 older comments
Walter Roberson
Walter Roberson on 10 Jul 2020
If I am typing something and I got notice that the original poster was also typing something, then I would want to be able to see what they wrote (when it gets posted) without losing what I have written (as would happen if I refreshed). Perhaps a "Save Draft" feature?
Adam Danz
Adam Danz on 10 Jul 2020
@Walter Roberson, sometimes I get a notification that OP left a comment while I'm constructing a response. In those cases, I usually either
  1. Open the thread in a new tab to see what OP wrote while my content is preserved in the original tab.
  2. Copy-paste what I've written into a text doc so that I can paste it back into the forum when needed.
madhan ravi
madhan ravi on 10 Jul 2020
@Adam I usually use the first point you mentioned.

Sign in to comment.


Sindar
Sindar on 10 Oct 2020 at 20:28
Being able to collapse items in the activity feed would be useful. Fairly regularly, I have 3-7 items for "X commented and edited their comment 5 times." Occasionally, I'll have a full page of items related to a longer discussion (usually on one of these meta-threads). It would be useful if I could manually (or Mathworks automatically) collapse large sets into single concise items ("X,Y,Z commented 30 times on an answer to the question What frustrates you about MATLAB? #2"). This would make it easier to scan my log without worrying about missing a more relevant item in the noise

  3 Comments

Walter Roberson
Walter Roberson on 10 Oct 2020 at 21:09
Yes, I agree. I know this has been proposed to Mathworks more than once.
Adam Danz
Adam Danz on 11 Oct 2020 at 17:45
Yep, I'd like that too.
Rik
Rik on 11 Oct 2020 at 22:37
This can happen especially when some users many several smaller edits in a row to the same comment/answer. It would be nice if those were merged in the first place.

Sign in to comment.


Image Analyst
Image Analyst on 13 Jul 2019
In Firefox v67, if you click on the m-file attached to a question, it offers to open it in MATLAB. But if I say to open it in MATLAB, it opens a new instance of MATLAB instead of using the existing, already open instance. Plus to make things worse, it does not even open the m-file at all. It just launches MATLAB with all your old m-files open.

  2 Comments

Walter Roberson
Walter Roberson on 14 Jul 2019
This is not happening for me on Mac.
Image Analyst
Image Analyst on 14 Jul 2019
It does however set the current folder to the temporary folder where the m-file gets downloaded to, however it doesn't go so far as to actually open the file in an editor window.

Sign in to comment.


Adam Danz
Adam Danz on 25 Feb 2020
Expand/Collapse all comments
This goes back to Matt Tearle's request in the first wish list (2011). An expand/collapes toggle button would be useful so we can search a page without having to expand all of the comments. For example, find "lOVIT" in this thread.
This feature already exists in the MathWorks documentation:

  3 Comments

Guillaume
Guillaume on 25 Feb 2020
FWIW, with the new 'less blank space' layout recently introduced, I suggested that all comments should be expanded by default. It's very rare that the first I do not do is expand the comments when looking at a post.
Walter Roberson
Walter Roberson on 25 Feb 2020
Well, I don't want all the comments expanded when I read this post. Or the one about error -9. Lots of history that is mostly irrelevant to the immediate concerns.
Adam Danz
Adam Danz on 25 Feb 2020
I would favor load-time over comment-accessibility. Some pages with lots of comments take quite a while to load. Even in the documentation, I often "collapse all in page" before scrolling through the page so I can find a section faster.

Sign in to comment.


madhan ravi
madhan ravi on 15 Jun 2020
It would be better if there is a feature that warns when the first word of the poster is Write. Because at the end the poster edits away the question making the thread look pointless wasting the answerers time.

  5 Comments

Show 2 older comments
Rik
Rik on 19 Jun 2020
I have the feeling this problem is getting worse, so a capture of the question at the time it is answered would really be nice. I hope it gets better when exam season is over.
Adam Danz
Adam Danz on 19 Jun 2020
This problem is definitly becoming more frequent. Here are some other suggestions.
  1. Users with sufficient reputation can flag other users who delete their questions. This flag will be visible in the stack of questions or when the thread is opened.
  2. A change-detection could detect when a certain percentage of content from a question is edited or removed which would trigger a confirmation dialog that requires the user to confirm the change and would warn the user that their profile will be flagged if the content is edited-away.
  3. First-time-posters or first-time-in-a-while posters have to accept a displayed agreement that their question-content could be edited but not removed or obfuscated so that users are aware that they are giving up their rights to privacy.

Sign in to comment.


per isakson
per isakson on 19 Aug 2020
Don't encourage the use of "matlab" and "simulink", by showing them as popular tags. Instead, encourage the use of the Product field.

  1 Comment

Image Analyst
Image Analyst on 19 Aug 2020
Yes, I bring that up constantly at board meetings. Should be really easy to fix but they just never seem to do it. Plus on the list is a better curated list of prepopulated tag suggestions. I've been bringing these up for literally like 5 or 6 years.
In fact every day or two I go in and remove the totally useless "matlab code" from 10 to 30 posts. Plus remove the "matlab coder" tag from posts that have nothing whatsoever to do with the coder toolbox. In fact, usually posters will put matlab, matlab code, matlab coder, and code ALL in there so I have to remove 4 tags on hundreds of posts per week. And often they'll throw in "help, help me, and problem" just to pile on the useless tags.

Sign in to comment.


Mario Malic
Mario Malic on 10 Oct 2020 at 10:20
When user sorts questions for which answer has not been accepted, the questions are found in two different sections. I believe this lowers the visibility of questions and adds an extra effort for the users who would like to help/contribute due to the fact that they have to filter by both statuses.
Filter by Status needs an addition or change: unsolved and solved. Furthermore, in unsolved status, there can be another one: answered/unanswered.

  3 Comments

Image Analyst
Image Analyst on 10 Oct 2020 at 14:21
How are you doing the initial filtering? Is it by these links:
or some other way? How would you change the above? Do you want "Answer Accepted" to be called "Solved" and "Answered" to be called "Answered and Solved"? Some posts that have not been officially "Accepted" are considered solved by the person(s) posting the answer(s), it's just that the original poster never accepted any answer.
Mario Malic
Mario Malic on 10 Oct 2020 at 15:39
Yes, those links.
Maybe something like this, where 'Answered' and 'Unanswered' would be grouped under one status, with the possibility of further filtering it. If questions are sorted by 'Date updated (Newest-Oldest)', all relevant questions will be higher in the feed. The questions that have received an answer that solves the issue, but have not been accepted yet, will not be updated and they will be lower in the feed.
  • Solved (Answer accepted)
  • Unsolved
  • - Answered
  • - Not answered
Image Analyst
Image Analyst on 10 Oct 2020 at 16:19
I agree that would be more explicit and intuitive

Sign in to comment.


Image Analyst
Image Analyst on 3 Jul 2019
When we insert a hyperlink into Answers from chain link button tool on the tool ribbon, the focus/cursor is not in the "Display Text" or "Target URL" field. It should be in one of them, preferably the Target URL field because I have a link in the clipboard all ready to be pasted in and I'd like to do that as soon as possible. Save us a step and put the cursor in one of the edit fields.

  5 Comments

Show 2 older comments
Walter Roberson
Walter Roberson on 8 Jul 2019
Jan: Interestingly, I do not encounter that problem on Firefox for Mac.
Guillaume
Guillaume on 8 Jul 2019
On the rare occasion that I do use the dialog, I've not encountered that problem either. Firefox on Windows (various FF versions on various computers with either win7 or win10).
Walter Roberson
Walter Roberson on 22 May 2020
These days the focus is in the target URL section -- that is, this is implemented.

Sign in to comment.


Image Analyst
Image Analyst on 3 Jul 2019
Firefox scrolling issue not fixed. I don't know if this happens in other browsers but if I go to comment or answer, the top of the edit box is off the top of the screen, so if I start typing immediately I can't see what I typed. I need to scroll down. It updates the screen with a nice sized edit box, but the top of it should not be above the viewable area.

  7 Comments

Show 4 older comments
Rik
Rik on 8 Jul 2019
Thanks, I thought something was crawling over my screen XD
madhan ravi
madhan ravi on 8 Jul 2019
I just panicked for a moment when I saw the comment with a bug crawling ;)
Image Analyst
Image Analyst on 17 Jul 2019
I'm not experiencing the scrolling off the top of the screen issue anymore. I think I've maybe updated Firefox since then. So maybe it was a Firefox issue that's been fixed. I'm now using Firefox version 68.0. I'll continue to see if the issue arises again.

Sign in to comment.


madhan ravi
madhan ravi on 8 Jul 2019
Whenever a text is edited by mobile [safari browser] , the click produces superfluous three letters " ltr " , which is really frustrating.

  2 Comments

Rik
Rik on 8 Jul 2019
I think it is odd how untested this editor feels for mobile. They probably put hours into testing for mobile as well, but as an end-user it doesn't feel that way.
madhan ravi
madhan ravi on 8 Jul 2019
True ;), hope it gets fixed soon as well.

Sign in to comment.


Adam
Adam on 29 Jan 2020
I realised I posted this in the ancient wishlist thread before.
Can we not have some white space back between answers? Since the last update all answers just roll into each other which looks frankly awful, almost to the point of being unusable for threads with multiple answers. White space is a good thing, in a forum as well as in code!
Different answers can often be significantly different. They shouldn't just flow straight into each other as though the 2nd was just a comment or continuation of a conversation in the 1st answer.

  7 Comments

Show 4 older comments
Adam
Adam on 30 Jan 2020
The location of the 'Answer this Question' button is annoying too.
Probably about 80-90% of my contributions are comments, usually on the question itself, but when you type your comment (assuming you managed to click the link to comment rather than answer in the first place), you have a small 'Submit' button and a much bigger 'Answer this Question' button right underneath it, shouting to be clicked. So far I have accidentally hit that button instead of the 'Submit' button numerous times.
It's all part of the same idea of needing to squash everything up rather than just spread things out so question, comments and answer clearly have their own obvious space.
We already used to have too many new people adding answers instead of comments.
Guillaume
Guillaume on 30 Jan 2020
Yes, it is also something we've complained about. Indeed with the new design I've accidentally posted an answer when I meant to post a comment, something I'd never done before. My suggestion was to move the button to the right. Yair's suggestion was to get rid of it altogether, not a bad idea as it forces potential answerers to actually scroll past (and thus read) answers.
Some things work very well with the new design (highlighted accepted answer, highlighted OP posts, structure of comments, less whitespace), others not so much. The whitespace cull may have been too aggressive.
Walter Roberson
Walter Roberson on 22 May 2020
With the new arrangement I have sometimes been accidentally posting as a Comment to the Question when I meant to post as an Answer.

Sign in to comment.


madhan ravi
madhan ravi on 12 Apr 2020
Why is there a lag in the recent activity page? This has never happened before.

  4 Comments

Show 1 older comment
Rik
Rik on 12 Apr 2020
I haven't noticed any particular lag, but a 1 minute lag is not unusual for me. If I recall correctly there was a several hour long lag for multiple people one time a while back, which I only noticed after it was resolved.

Sign in to comment.


Rik
Rik on 4 Jun 2020
A soft-lock for questions, similar to StackExchange.
This soft-lock would prevent low/no-reputation users (e.g. <5) from posting answers in threads that have the same answer over and over again, like the date validation assignment, the school admission assignment, and the picker function assignment (each of these probably have multiple incarnations). One example of a non-homework thread with this issue is this thread, which contains a stream of complaints and single-word answers.
That last one is probably due to people not being allowed to post a comment to the question, so the only button is 'answer this question', which seems like poor design IMHO.

  4 Comments

Show 1 older comment
Rik
Rik on 31 Jul 2020
This soft-lock would also be usefull for thread like this one, to force people to post new answers in the new threads.
Adam Danz
Adam Danz on 31 Jul 2020
Large threads like this also need a mechanism to speed up the page loading time.
I prefer a mechanims that shows collapsed answers that require an expansion to view nested comments after the number of answers exceeds a threshold and the nested comments would load only when expanded. Additionally, a second greater threshold could be set to initialize a "view more" option such that only the first 'n' answers would appear in order of votes. These larger threads often consume so much load-time that I'm reluctant to view new answers/comments.
Rik
Rik on 31 Jul 2020
Until such features as you suggest are implemented, splitting the threads seems the only viable option. I share your point, especially on mobile I don't bother to open up the long threads.

Sign in to comment.


madhan ravi
madhan ravi on 10 Jul 2020
Not mandatory but a replying feature to a specific comment would be nice.

  0 Comments

Sign in to comment.


Rik
Rik on 8 Jul 2019
Editor support on mobile seems not fully tested. (I'm using Android 9 (Lineage OS), with Chrome as browser and Swiftkey as the keyboard)
This morning I tried editing an answer, but I got the new editor, which meant I couldn't select text and click the code button. When posting a comment I suddenly got the workaround (the old style editor with a preview window).
I tried setting the browser to desktop mode, but then all the admin tools disappeared, so I couldn't edit the answer anymore.

  3 Comments

Walter Roberson
Walter Roberson on 8 Jul 2019
The old style editor can be used for new content and for editing content that was created before the new style editor was turned on.
Rik
Rik on 8 Jul 2019
Hmm. I can understand the compatibility-issues this would prevent, but it is still something that is waiting for a more optimal solution.
Guillaume
Guillaume on 8 Jul 2019
The current implementation was implemented as a workaround for the fact that the new editor was completely unusable on mobiles. It's certainly not supposed to be like that but until the new editor actually works on mobiles that's what we're stuck with.

Sign in to comment.


Rik
Rik on 24 Jul 2019
Maybe this idea has been suggested before, but maybe it would be good to have a down vote button. I sometimes see answers of questionable quality, where I don't know where to start to explain why it is such a bad idea. I don't think they should be outright deleted, and a flag doesn't really seem the solution either.
Is this something that I will just have to learn to deal with? Or is there some feature that would solve this?
(obviously I will not link to any recent examples, but you could look up some of my embarrassing first answers)

  1 Comment

Walter Roberson
Walter Roberson on 24 Jul 2019
If I recall correctly we decided against downvotes early on, feeling that it would be better to comment or to post better answers (that might include material showing that the alternative would not work)

Sign in to comment.


darova
darova on 14 Aug 2019
I want a button for spoiler
Can't believe there is no such option on this forum

  7 Comments

Show 4 older comments
Rik
Rik on 14 Aug 2019
Automatically collapsing code blocks that contain more than 10 lines or so might indeed be a useful thing. I would argue against something like that being user-controlable because than we get the scenario Guillaume is describing.
Image Analyst
Image Analyst on 14 Aug 2019
It might be used for homework answers where you give a hint first, then the hidden spoiler below it. However I don't see any student who would just take the hint and not reveal the answer hidden by the spoiler button.
Or maybe for riddles/jokes??
Smart Dogs.png
darova
darova on 14 Aug 2019
Can someone please vote for my answer?

Sign in to comment.


Star Strider
Star Strider on 30 Jan 2020
It would be nice to have advance warning of some type that the site is going down for maintenance, and how long it will be until it will be back up.
For me today it was down from 17:00 UCT 29 Jan 2020 until 03:00 UCT 30 Jan 2020. Some parts are still not back up.

  8 Comments

Show 5 older comments
David
David on 30 Jan 2020
This outage was unplanned and we're still looking into the cause.I'll post more as we zero in on the root cause.
Image Analyst
Image Analyst on 30 Jan 2020
I was on frequently yesterday and the day before and I never got any "unavailable" message. I'm in the USA and (I guess) use the USA server.
David
David on 30 Jan 2020
Thanks for the info @Image Analyst. We don't think the issue was affecting all users but perhaps some users in some locations or some users at specfic times.

Sign in to comment.


madhan ravi
madhan ravi on 3 May 2020
Why is it impossible to copy paste code from MATLAB mobile?

  4 Comments

Show 1 older comment
madhan ravi
madhan ravi on 5 May 2020
Thank you Anusha for the response. For instance I’m able to copy paste any characters outside MATLAB Mobile except inside it. MATLAB Online (Version 8) iOS.
PS: I just checked in my App Store before commenting updated the app to version 8.1 and now seems to work correctly:).
Walter Roberson
Walter Roberson on 5 May 2020
MATLAB Mobile (for Android) is a nuisance for copying characters out of. You can select and copy output, and you can select and copy input, but you cannot select a mixed region (as you might well want to do in order to post a trace showing commands and related output)
Anusha Sridharan
Anusha Sridharan on 6 May 2020
Thanks @Walter, I have shared your feedback with the MATLAB Mobile team.
@Madhan, Good to know that it is working after the update!

Sign in to comment.


Adam Danz
Adam Danz on 13 May 2020
Edited: Adam Danz on 13 May 2020
I just realized today that you can name a table variable with leading or trailing whitespace which prevents you from accessing that variable from the table using dot notation. A space could be added accidentally and it's difficult to see the space from the table displayed in the command window so it's not immediately obvious what the problem is. I can't imagine a benefit to allowing leading/trailing whitespace in variable names. (r2020a)
Table functions should either trim the leading/trailing white space or throw an error when it's detected.
Here's a demo for trailing whitespace
T = table(1,0,'VariableNames',{'A', 'B '});
% Notice the extra space -------------^
% The space is visible but not noticeable unless you're looking for it.
% T =
% 1×2 table
% A B
% _ __ <-- slighly longer bar
% 1 0
% Now access the variables
K>> T.A
% ans =
% 1
K>> T.B% no space
% Unrecognized table variable name 'B'.
K>> T.B % +1 space
% Unrecognized table variable name 'B'.
% This works when space is added
K>> T(:,'B ')
% ans =
% table
% B
% __
% 0
% You can see the space in the VariableNames
K>> T.Properties.VariableNames
% ans =
% 1×2 cell array
% {'A'} {'B '}
Here's a demo for leading whitespace
T = table(1,0,'VariableNames',{'A', ' B'});
% Notice the extra space ------------^
% T =
% 1×2 table
% A B
% _ __ <-- slighly longer bar
% 1 0
K>> T.A
% ans =
% 1
K>> T.B% no space
% Unrecognized table variable name 'B'.
K>> T. B% +1 space
% Unrecognized table variable name 'B'.
% This works when space is added
K>> T(:,' B')
% ans =
% table
% B
% __
% 0
% You can see the space in the VariableNames
K>> T.Properties.VariableNames
% ans =
% 1×2 cell array
% {'A'} {' B'}

  8 Comments

Show 5 older comments
Adam Danz
Adam Danz on 14 May 2020
If whitespace were trimmed when comparing variable names, all of the following variable names would be the same.
T = table(1,2,3,4,5,'VariableNames',{'A',' A ',' A','A ','A '})
% T =
% 1×5 table
% A A A A A
% _ ___ __ __ ___
% 1 2 3 4 5
I guess it's up to the user to realize what the variable names are or to carefully check them in T.Properties.VariableNames.
Steven Lord
Steven Lord on 14 May 2020
Looking at those variables names at a higher level, where did they come from? If they came from a file being imported (as Sean suggested may be the case) I'd ask the person who created the file (or owns the code or process that creates that file) if the leading or trailing spaces are significant and if it is possible to modify the creation process if they aren't.
Even if it isn't possible, if they're not significant you could replace the variable names with unique names sans "external" spacing.
T = table(1,2,3,4,5,'VariableNames',{'A',' A ',' A','A ','A '})
VN = T.Properties.VariableNames;
uniqueVN = matlab.lang.makeUniqueStrings(strip(VN));
T2 = renamevars(T, VN, uniqueVN)
Sean de Wolski
Sean de Wolski on 15 May 2020
Or if you're reading the table from a file disable PreserveRowNames which makes a valid name for you. https://www.mathworks.com/help/releases/R2020a/matlab/ref/readtable.html#d120e1046459

Sign in to comment.


madhan ravi
madhan ravi on 8 Jun 2020
Why is it not possible to see the code button when editing a comment in mobile?

  4 Comments

Show 1 older comment
madhan ravi
madhan ravi on 8 Jun 2020
Thanks Rik, I’m using safari in my iPhone.
Walter Roberson
Walter Roberson on 8 Jun 2020
Unfortunately in the mobile editor, you cannot select text, which makes the code button much less useful.
The work-around is to insert at least one space at the beginning of the first line of each "paragraph" of code. The effect ends at the first empty line. Adding a space at the beginning of each line of code works too, but is a bit of a nuisance for longer blocks of code.

Sign in to comment.


madhan ravi
madhan ravi on 18 Jun 2020
Just an opinion. It would be great to restrict fake biased account created to just to vote.

  2 Comments

Rik
Rik on 19 Jun 2020
Is this a big issue? I have never noticed it myself.
madhan ravi
madhan ravi on 19 Jun 2020
Eh actually no it's not a big issue . Getting a reward is different from buying a reward.

Sign in to comment.


madhan ravi
madhan ravi on 25 Jun 2020
What's happening in mobile versions of MATLAB Answers?? I just a blank space to type something without the code button and the other formatting tools.

  5 Comments

Show 2 older comments
Walter Roberson
Walter Roberson on 25 Jun 2020
The Answers server code was upgraded a few days ago.
madhan ravi
madhan ravi on 25 Jun 2020
Ah I see now, the toggle button seems interesting and makes it easier to find the crucial details of a comment/question/answer.

Sign in to comment.


Walter Roberson
Walter Roberson on 26 Jun 2020
Edited: Walter Roberson on 26 Jun 2020
HTML links that are inside Monospace are not clickable, and their link destination cannot be read out by hovering over them. They still show up as blue though.

  7 Comments

Show 4 older comments
Image Analyst
Image Analyst on 26 Jun 2020
For me, same as Star - works fine in Firefox/Win10, hovering and clicking both work. By the way, the link in the post has "null" as the URL, which you can see if you edit it, so it makes sense that that link goes nowhere.
Rik
Rik on 26 Jun 2020