필터 지우기
필터 지우기

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