Error in Assignin with strings
Show older comments
Hi Matlab users,
I have to create an cell array: cases = {'mean' 'min' 'max' 'std' 'm3' 'm4' 'm6' 'm8' 'm10' 'm25'} - This is an user input and user will enter : 'mean' 'min' 'max' 'std' 'm3' 'm4' 'm6' 'm8' 'm10' 'm25' , and I would like to use assignin to read it into the workspace. But when I read it into the workspace using strread, i am getting error like this- "Second input must be a filename or string to parse".
assignin('base','cases',strread(get(handles.cases_tag,'string')),'%s','delimiter',' ')
can anyone help how to create an cell array with the user input.
Answers (1)
Walter Roberson
on 28 Apr 2012
assignin('base', 'cases', strread(get(handles.cases_tag,'string'), '%s', 'delimiter', ' '))
That is, you had a ) in the wrong place.
Categories
Find more on Characters and Strings in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!