Results 1 to 2 of 2

Math Help - How to make generic filenames work in matlab?

  1. #1
    Newbie
    Joined
    Jun 2010
    Posts
    1

    How to make generic filenames work in matlab?

    I've got a 1x1cell named selected_name that contains different names depending on how the function is run. So when I type selected_name in the command line it returns "selected_name = 'Peter'" for example.

    What I want to do is to save the variables used in the workspace to a file named "Peter.mat". I can't get it to work. save(selected_name) does not work because it says it needs to be a string like save('somename').

    How do I solve this?
    Follow Math Help Forum on Facebook and Google+

  2. #2
    Member
    Joined
    Mar 2007
    Posts
    206
    Awards
    1
    try:
    Code:
    save(selected_name(1))
    Follow Math Help Forum on Facebook and Google+

Similar Math Help Forum Discussions

  1. Replies: 1
    Last Post: March 1st 2011, 01:57 PM
  2. Can't make simple iteration work
    Posted in the Calculus Forum
    Replies: 5
    Last Post: August 4th 2010, 04:03 AM
  3. How to make this function in matlab
    Posted in the Math Software Forum
    Replies: 0
    Last Post: December 15th 2009, 10:41 AM
  4. matlab - it make me crazy!!
    Posted in the Math Software Forum
    Replies: 0
    Last Post: November 28th 2009, 08:27 AM
  5. Replies: 1
    Last Post: September 30th 2008, 11:23 AM

Search Tags


/mathhelpforum @mathhelpforum