フィルターのクリア

making a result table

1 回表示 (過去 30 日間)
sama
sama 2015 年 4 月 21 日
コメント済み: sama 2015 年 4 月 22 日
Hello,
The code that I am writing is using ginput. for example I select 2 points and t1, C1, and C2 are calculated. For showing result at table, how can I name each row like #1?
The ginput gets the number of input so I don't have a specific row number. I tried following code and get an error.
R=[1:m];
s=num2str(R)
TT=table(t1,C1,C2,...
'RowNames',s)
Thanks

採用された回答

Peter Perkins
Peter Perkins 2015 年 4 月 22 日
At a minimum, num2str(1:m) isn't going to generate a cell vector of strings, which is what the row names need to be. For example:
>> num2str(1:5)
ans =
1 2 3 4 5
However, this will:
>> strsplit(num2str(1:5),' ')
ans =
'1' '2' '3' '4' '5'
  1 件のコメント
sama
sama 2015 年 4 月 22 日
Thank you so much. It was helpful :)

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

その他の回答 (0 件)

カテゴリ

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

タグ

Community Treasure Hunt

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

Start Hunting!

Translated by