Drexel dragonThe Math ForumDonate to the Math Forum



Search All of the Math Forum:

Views expressed in these public forums are not endorsed by Drexel University or The Math Forum.


Math Forum » Discussions » Software » comp.soft-sys.matlab

Topic: Text Input Yields Different Type of Array
Replies: 1   Last Post: Jan 27, 2013 10:35 AM

Advanced Search

Back to Topic List Back to Topic List Jump to Tree View Jump to Tree View   Messages: [ Previous | Next ]
dpb

Posts: 8,112
Registered: 6/7/07
Re: Text Input Yields Different Type of Array
Posted: Jan 27, 2013 10:35 AM
  Click to see the message monospaced in plain text Plain Text   Click to reply to this topic Reply

On 1/27/2013 8:46 AM, Jeff wrote:
> I'm building an application that allows someone to first create a
> department by entering the name of the department in an editable text
> box. Hit save and they are done. Then if the name names to be changed
> The app uses a different form but again you simply enter the name in a
> text box hot save and you are done. Here's the problem. When the name is
> first created, the array is listed as a char array. However, when the
> name is changed the array is labeled as a cell array. I've provided the
> code below. I fixed the issue by removing the curly brackets from the
> name change, but I don't understand why it is different.
> Code to add Department or Change Name
>
> department.Name(dptID) = {get(handles.departmentName, 'String')}


Apparently because the other code doesn't create a cell (via the
curlies) -- would have to see it to tell what you actually did.

For strings, generally cell strings are easier to deal with than
character arrays altho if it's only a structure field and is only used
thereby it may not make too much difference...

--




Point your RSS reader here for a feed of the latest messages in this topic.

[Privacy Policy] [Terms of Use]

© Drexel University 1994-2014. All Rights Reserved.
The Math Forum is a research and educational enterprise of the Drexel University School of Education.