Sening a string to server

조회 수: 7 (최근 30일)
Mindy
Mindy 2013년 4월 19일
I am sending a string containing variable(s) to our server engine, such as this: variable = 30; Q = ['string' num2str(variable) 'string]
It works most of the time, but once a while, when the server gets Q, it gets the MATLAB code "num2str(variable)" instead of "30". So the server gets confused since it doesn't know any MATLAB code.
I am wondering if there is internal matlab code fixes can be done or any suggestions on my code.
Thanks

답변 (1개)

Walter Roberson
Walter Roberson 2013년 4월 20일
Try
Q = sprintf('string%dstring', Q);
Your example is missing a quote mark, ', so possibly your code is as well.

카테고리

Help CenterFile Exchange에서 String Parsing에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by