Info

이 질문은 마감되었습니다. 편집하거나 답변을 올리려면 질문을 다시 여십시오.

Execute command syntax

조회 수: 3 (최근 30일)
K Kallerhoff
K Kallerhoff 2012년 6월 18일
댓글: Stephen23 2022년 1월 1일
Hi, I need to change a value with and execute command like this
value = 1;
Execute(handles.server, 'test.a(1)=value')
but is only works, if the you type a number instead of value like this
Execute(handles.server, 'test.a(1)=1')
any suggestions?
Thanks Kay
  댓글 수: 1
Stephen23
Stephen23 2022년 1월 1일
"any suggestions?"
Call PutWorkspaceData first, as the Execute examples show:

답변 (1개)

Voss
Voss 2021년 12월 31일
The character array 'test.a(1)=value' contains the word 'value' rather than the value of the variable "value". You can use sprintf() to get a variable number into a character array:
value = 1;
Execute(handles.server, sprintf('test.a(1)=%d',value))

이 질문은 마감되었습니다.

Community Treasure Hunt

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

Start Hunting!

Translated by