Executing .exe files using system command or "!" - passing arguments as a variable, without manually entering each time.
2 visualizaciones (últimos 30 días)
Mostrar comentarios más antiguos
Sai
el 18 de Nov. de 2013
Comentada: Sai
el 18 de Nov. de 2013
i have a simple code written in c(hello.cpp file) and made an executable file out of it. -- please find the attachment
now testing this hello.exe file generated, in matlab: hello.m
this gives me a result
- decryption
- messages:data
- mac_trunc_verify:encrypt_data
- message_ID:12
- counter_lv=4
but what i am expecting is: with the hello_new.m file without entering the values manually beacuse my data keeps changing
- decryption
- messages:data
- mac_trunc_verify:encrypt_data
- message_ID:12
- counter_lv=4
instead my result is
- decryption
- messages:a
- mac_trunc_verify:b
- message_ID:c
- counter_lv=d
0 comentarios
Respuesta aceptada
Walter Roberson
el 18 de Nov. de 2013
system(sprintf('"hello.exe" %s %s %s %s', a, b, c, d));
Remember, when you have something inside of quotation marks, it is a string and variable names will not be substituted to values within it.
Más respuestas (0)
Ver también
Categorías
Más información sobre Structures en Help Center y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!