フィルターのクリア

how to solve this issue?

1 回表示 (過去 30 日間)
vijay chandra
vijay chandra 2017 年 10 月 17 日
コメント済み: vijay chandra 2017 年 10 月 17 日
Log_name=strtrim(['ArxmlLog.Struct_Pdus.',strcat('Struct_Pdu',num2str(pduCount))]);
If I use this line I will get structure like Struct_Pdu_1
But I want to get like this Struct_Pdu.(1)
Struct_Pdu_1 ====> Struct_Pdu.(1)
Instead of _1 =====> .(1)

採用された回答

Guillaume
Guillaume 2017 年 10 月 17 日
編集済み: Guillaume 2017 年 10 月 17 日
If I use this line I will get structure like Struct_Pdu_1
a) you don't get a structure at all, you get a char array (with the word struct in it).
b) what you get is of the form ArxmlLog.Struct_Pdus.Struct_Pdu1, no _ between Pdu and the number.
c) that's a needlessly complicated syntax, we have an strtrim that has nothing to strim and a redundant strcat that does the same as the [] it's embedded in.
I'm not sure what you're trying to do. If you are trying to create a char array, then:
Log_Name = sprintf('ArxmlLog.Struct_Pdus.Struct_Pdu(%d)', pduCount);
would be one way. Possibly, the 2nd Struct_Pdu is supposed to come from a variable, in which case:
fname = 'StructPdu';
Log_Name = sprintf('ArxmlLog.Struct_Pdus.%s(%d)', fname, pduCount);
  1 件のコメント
vijay chandra
vijay chandra 2017 年 10 月 17 日
I will get structures as I told like above. Thank you Guillaume. Your commands helped me to get what I want exactly.

サインインしてコメントする。

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeStructures についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by