format column with compose

here i format row :
formatSpec = "%d - %s";
RowName=compose(formatSpec,t2,sis);
but if i want to format columns? how can i do?

6 件のコメント

Dyuman Joshi
Dyuman Joshi 2023 年 11 月 5 日
Remove the prefix serial numbers and tranpose the output.
piero
piero 2023 年 11 月 5 日
"Remove the prefix serial numbers" what is?
Dyuman Joshi
Dyuman Joshi 2023 年 11 月 5 日
The 1 -, 2 - , 3 - , ... you have at the start of the strings, which is not there in the 2nd image.
piero
piero 2023 年 11 月 5 日
i want to do this: "1 - A" "2 - B"
dpb
dpb 2023 年 11 月 5 日
@piero is presuming (as best info we have since you didn't provide testing dataset) the "1 - " prefix in your first image is real.
If so, then
RowName=extractAfter(compose(formatSpec,t2,sis),"- ").';
should be the magic incantation you're looking for.
If not, attach a (small) example dataset for folks to play with...
piero
piero 2023 年 11 月 5 日
編集済み: piero 2023 年 11 月 5 日
"should be the magic incantation you're looking for" :DD
RowColumn=RowName'; ==> this solution is ok! thank

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

回答 (0 件)

カテゴリ

ヘルプ センター および File ExchangeData Import and Analysis についてさらに検索

質問済み:

2023 年 11 月 5 日

編集済み:

2023 年 11 月 5 日

Community Treasure Hunt

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

Start Hunting!

Translated by