Problems with MaskDisplay command
    조회 수: 6 (최근 30일)
  
       이전 댓글 표시
    
Hi,
I've a simulink block and I set for it
disp('{\bf\it\fontsize{20}\fontname{Calisto MT}MODEL}', 'texmode','on'); 
port_label('output', 1, 'qpp'); 
port_label('output', 2, 'qp'); 
port_label('output', 3, 'q'); 
port_label('input', 1, 'u');
by the Mask Editor. Now I want apply it at a new block using matlab commands, I do:
set_param('sys/blockname', 'MaskDisplay', {'disp('{\bf\it\fontsize{20}\fontname{Calisto MT}MODEL}', 'texmode','on'); port_label('output', 1, 'qpp'); port_label('output', 2, 'qp'); port_label('output', 3, 'q'); port_label('input', 1, 'u')'})
it returns:
set_param('sys/blockname', 'MaskDisplay', {'disp('{\bf\it\fontsize{20}\fontname{Calisto MT}MODEL}', 'texmode','on'); port_label('output', 1, 'qpp'); port_label('output', 2, 'qp'); port_label('output', 3, 'q'); port_label('input', 1, 'u')'})
                                              |
Error: Unbalanced or unexpected parenthesis or bracket.
댓글 수: 0
채택된 답변
  Kaustubha Govind
    
      
 2013년 9월 23일
        You can just execute what you're passing in as the third parameter to set_param to make sure that it's a string (and not a cell-array). I get the same error in MATLAB when I say:
>> {'disp('{\bf\it\fontsize{20}\fontname{Calisto MT}MODEL}', 'texmode','on'); port_label('output', 1, 'qpp'); port_label('output', 2, 'qp'); port_label('output', 3, 'q'); port_label('input', 1, 'u')'}
   {'disp('{\bf\it\fontsize{20}\fontname{Calisto MT}MODEL}', 'texmode','on'); port_label('output', 1, 'qpp'); port_label('output', 2, 'qp'); port_label('output', 3, 'q'); port_label('input', 1, 'u')'}
           |
  Error: Unbalanced or unexpected parenthesis or bracket.
Just from a cursory glance, the problem is that you are not escaping the quotes in the string. So you need:
   set_param('sys/blockname', 'MaskDisplay', 'disp(''{\bf\it\fontsize{20}\fontname{Calisto MT}MODEL}'', ''texmode'',''on''); port_label(''output'', 1, ''qpp''); port_label(''output'', 2, ''qp''); port_label(''output'', 3, ''q''); port_label(''input'', 1, ''u'')')
댓글 수: 0
추가 답변 (0개)
참고 항목
카테고리
				Help Center 및 File Exchange에서 Filter Analysis에 대해 자세히 알아보기
			
	Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!

