Info

Diese Frage ist geschlossen. Öffnen Sie sie erneut, um sie zu bearbeiten oder zu beantworten.

Execute command syntax

3 Ansichten (letzte 30 Tage)
K Kallerhoff
K Kallerhoff am 18 Jun. 2012
Kommentiert: Stephen23 am 1 Jan. 2022
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 Kommentar
Stephen23
Stephen23 am 1 Jan. 2022
"any suggestions?"
Call PutWorkspaceData first, as the Execute examples show:

Antworten (1)

Voss
Voss am 31 Dez. 2021
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))

Diese Frage ist geschlossen.

Community Treasure Hunt

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

Start Hunting!

Translated by