Matlab合并的字符串中带有单引号

9 views (last 30 days)
Xiaoning.Wang
Xiaoning.Wang on 3 Jul 2023
Answered: Xiaoning.Wang on 3 Jul 2023
matlab在合并字符串的时候,如果字符串中有单引号,如何处理单引号

Answers (1)

Xiaoning.Wang
Xiaoning.Wang on 3 Jul 2023
单号号,可以使用三个单引号,进行处理
如:
>> ['set_param(char(ds_Sw),' '''OutDataTypeStr''' ',' 'myname)']
ans =
set_param(char(ds_Sw),'OutDataTypeStr',myname)

Categories

Find more on MATLAB 快速入门 in Help Center and File Exchange

Products


Release

R2016b

Community Treasure Hunt

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

Start Hunting!