Results 1 to 2 of 2

Math Help - Matlab: Loading from strings

  1. #1
    Newbie
    Joined
    Apr 2008
    Posts
    1

    Matlab: Loading from strings

    I have a problem with matlab. I have created a function to which the only variable I wish to send is a filename (as a textstring). In the function I want to load this file and access the data in it. The problem seems to be that the function load doesn't understand how to evaluate the string and load the therein specified file.

    Does anybody know if there is a way around this problem?
    Follow Math Help Forum on Facebook and Google+

  2. #2
    Grand Panjandrum
    Joined
    Nov 2005
    From
    someplace
    Posts
    14,972
    Thanks
    4
    Quote Originally Posted by Leo Fender View Post
    I have a problem with matlab. I have created a function to which the only variable I wish to send is a filename (as a textstring). In the function I want to load this file and access the data in it. The problem seems to be that the function load doesn't understand how to evaluate the string and load the therein specified file.

    Does anybody know if there is a way around this problem?
    "help load"

    Assuming your data is in an ASCII file with a .dat extension I would try:

    fl='fullpath\filename.dat'
    S= load(fl);

    (and note what the help says about how load is going to treat the data)

    RonL
    Follow Math Help Forum on Facebook and Google+

Similar Math Help Forum Discussions

  1. Optimal loading truck
    Posted in the Algebra Forum
    Replies: 0
    Last Post: May 12th 2011, 03:15 AM
  2. Probability and Dice Loading
    Posted in the Statistics Forum
    Replies: 8
    Last Post: May 24th 2010, 04:45 PM
  3. MATLAB: Loading a file and digits
    Posted in the Math Software Forum
    Replies: 2
    Last Post: May 20th 2010, 09:55 AM
  4. Matlab - Need help on strings
    Posted in the Math Software Forum
    Replies: 1
    Last Post: March 28th 2010, 11:45 AM
  5. Loading Data in Matlab
    Posted in the Math Software Forum
    Replies: 3
    Last Post: May 7th 2009, 09:06 PM

Search Tags


/mathhelpforum @mathhelpforum