Matlab for Beginners

Post Reply
User avatar
urnash
Posts: 0
Joined: Thu Jan 01, 2004 12:00 am

Matlab for Beginners

Post by urnash »

I know it's a small threadjack but: earlier in this thread we discussed the speed of R vs Matlab. I've just found http://www.cybaea.net/Blogs/Data/Faster-R-through-better-BLAS.html which describes different ways of speeding up R. Hope this helps someone...
mattcushman: happiness levels are a I(0) process, not I(1).
User avatar
Maggette
Posts: 0
Joined: Thu Jan 01, 2004 12:00 am

Matlab for Beginners

Post by Maggette »

Actually I don't really need it right now, but thanks for the link. This sounds interesting and is good to know it exists. Thanks
Ich kam hierher und sah dich und deine Leute lächeln, und sagte mir: Maggette, scheiss auf den small talk, lass lieber deine Fäuste sprechen...
User avatar
Praetorian
Posts: 0
Joined: Thu Jan 01, 2004 12:00 am

Matlab for Beginners

Post by Praetorian »

Another note on R Performance: For Intel Machines the fastest solution is to link against Intel MKL. Revolution R gives you optimized Builds out of the box under windows. For Linux Users a Revolution version is available for Ubuntu (but only R2.9.2). A general installation tutorial for Linux can be found at: http://psyccomputing.blogspot.com/2010/04/compiling-64-bit-r-2101-with-mkl-in.html - i used that to speed up my Amazon Cloud Environment.
taa
Posts: 1
Joined: Thu Jan 01, 2004 12:00 am

Matlab for Beginners

Post by taa »

Hi all



I need a (1xN) vector of dates in the following format "yyyymmdd" (i.e. 19960101) for a for-loop.



start_date = datenum('01-Jan-1996');

end_date = datenum('31-Dec-2012');



date = datevec(start_date:1:end_date);



How should I proceed?



Thx for your help!!
djfostner
Posts: 0
Joined: Thu Jan 01, 2004 12:00 am

Matlab for Beginners

Post by djfostner »

If you're looking to get the data into a vector of formatted strings you could use the built-in datestr command.



dateString = datestr(date,'yyyymmdd');



Hope that helps.
taa
Posts: 1
Joined: Thu Jan 01, 2004 12:00 am

Matlab for Beginners

Post by taa »

Thx for that, djfostner.



Unfortunately, I had this before and I dont know how to access/use the first, second etc. value in dateString.



Afterwards I would like to use sprintf in a for-loop to combine a hyperlink with the date in the above mentioned vector.



Thx again
User avatar
silverside
Posts: 0
Joined: Thu Jan 01, 2004 12:00 am

Matlab for Beginners

Post by silverside »

in approximate order of complexity (and reverse order of speed):



use a for loop with datestr()



or



use cellfun()



or

use a custom-written loop using preallocated strings for numbers from 1 to 12, 1 to 31, and 0 to 99. date-related functions in matlab are notoriously slow.
Let's jet out, we'll cruise at hyperspeed, I've got the beat, I've got the beat and that's all we need
User avatar
tabris
Posts: 0
Joined: Thu Jan 01, 2004 12:00 am

Matlab for Beginners

Post by tabris »

Ok this might be a real basic question but I am unsure of how to do this.



I would like to set my machine timezone from matlab to another timezone whilst running a script in matlab and then convert it back. How would I do this actually or is this possible?
Dilbert: Why does it seem as though I am the only honest guy on earth? Dogbert: Your type tends not to reproduce.
User avatar
tristanreid
Posts: 0
Joined: Thu Jan 01, 2004 12:00 am

Matlab for Beginners

Post by tristanreid »

I can give you a script that will do this, but may I ask:  is this for string formatting purposes?  There may be better alternatives.  If for no other reason, you're going to mess up your calendar if you keep switching back and forth - any invite that gets received during this time has high probability of getting jacked. 



Here's a Matlab example of converting local to UTC, although you're going to need Java installed for this to run (and CLASSPATH set in Matlab)



http://www.mathworks.com/matlabcentral/fileexchange/22295-localtimetoutc/content/local_time_to_utc.m
If you can make computers as smart as humans you will have invented a machine that can sing the words to the Flintstones tune but will forget to pay the phone bill.
User avatar
tabris
Posts: 0
Joined: Thu Jan 01, 2004 12:00 am

Matlab for Beginners

Post by tabris »

Thanks! And no it is not for date formating, I actually have to call an executable file that requires my timezone as an input and I cannot recompile this file since I do not have the source code.



Don't worry I do not have many invites so this patch work will do!
Dilbert: Why does it seem as though I am the only honest guy on earth? Dogbert: Your type tends not to reproduce.
Post Reply