Matlab for Beginners

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

Matlab for Beginners

Post by tristanreid »

Cool.



To call a powershell script from Matlab:

http://www.mathworks.com/support/solutions/en/data/1-EV4ZDX/index.html?product=ML&solution=1-EV4ZDX



Powershell script:

http://gallery.technet.microsoft.com/scriptcenter/Set-TimeZone-function-b5ed93b5



-t.
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 »

Works great Tristan. Only problem I am having is passing variables into that function... somehow I cannot past string variables into the script.



For instance:

!powershell -inputformat none -command "& { . C:\matlab\stz.ps1; Set-Timezone 'Pacific Standard Time' }"



works perfectly but if I want 'Pacific Standard Time' to be a generated variable from matlab, I can't seem to figure out a way to do so.
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 »

Put the whole line in a string with the time zone you want, including the bang at the beginning, and call it with eval.



-t.
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 »

argh thats right. thanks! totally forgot about eval... was trying to use system instead. good thing this thread is for beginners ha
Dilbert: Why does it seem as though I am the only honest guy on earth? Dogbert: Your type tends not to reproduce.
Post Reply