Error in Assignin with strings

1 次查看(过去 30 天)
Karthik KJ
Karthik KJ 2012-4-28
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.

回答(1 个)

Walter Roberson
Walter Roberson 2012-4-28
assignin('base', 'cases', strread(get(handles.cases_tag,'string'), '%s', 'delimiter', ' '))
That is, you had a ) in the wrong place.

类别

Help CenterFile Exchange 中查找有关 Migrate GUIDE Apps 的更多信息

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by