The Math Forum

Search All of the Math Forum:

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

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

Notice: We are no longer accepting new posts, but the forums will continue to be readable.

Topic: Help using textscan or sscanf
Replies: 21   Last Post: Jan 23, 2013 4:02 PM

Advanced Search

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

Posts: 9,850
Registered: 6/7/07
Re: Help using textscan or sscanf
Posted: Jan 20, 2013 9:39 AM
  Click to see the message monospaced in plain text Plain Text   Click to reply to this topic Reply

On 1/20/2013 12:48 AM, Kevin Ellis wrote:

> I feel bad. I knew this was a challenging problem, but I'm impressed.
> The solution you came up with significantly reduces the runtime. One
> thing I should mention is that I have had to copy the section of code 12
> times for each month of the year. I call the dataset using datenum for
> each month ('001' for October all the way to '012' for September).I
> append that number onto the end of the number that your code made above.

Why would you replicate the code 12 times???? Wrap it in a function and
pass the month or somesuch...

> So you were able to accomplish the task in much fewer lines of code
> which is very impressive. Who knew it could be so simple. Too bad there
> isn't a built-in function in MatLab where you can just read strings
> right to left. That would make things much easier....

Well, again, if you want that function, write one that does it. A very
high fraction of Matlab functionality is just that: m- or p-files that
add the higher-level abstraction to the base language. Using the same
ideas for user code simplifies development in a specific application domain.


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

[Privacy Policy] [Terms of Use]

© The Math Forum at NCTM 1994-2018. All Rights Reserved.