フィルターのクリア

How can i have together in the same cell, lines with number values and one line with duration in HH:mm:ss:SSS?

1 回表示 (過去 30 日間)
Hello,
I don't know if i have expressed my question in a good and understandable way.
I will try to describe it now.
I have a cell file for example: 4x5 cell
The first 3 lines are just numbers, while the 4th line is duration in HH:mm:ss:SSS but in a cell form.
My output is a cell file 4x5 like this:
5 5 5 5 5
3 3 3 3 3
4 4 4 4 4
1x1duration 1x1duration 1x1duration 1x1duration 1x1duration
But i want to have the duration like this:
5 5 5 5 5
3 3 3 3 3
4 4 4 4 4
HH:mm:ss HH:mm:ss HH:mm:ss HH:mm:ss HH:mm:ss
I must make a change in the format probably but i don't know how...
Any ideas?
  1 件のコメント
Angelos Mongolias
Angelos Mongolias 2019 年 1 月 14 日
Char() seems to work, applying it and changing the duration array before I put the 4rth line in the file.

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

採用された回答

Guillaume
Guillaume 2019 年 1 月 14 日
Unfortunately, when you look at a cell array in the current version of matlab, matlab only shows the size and type of durations arrays even for scalar ones instead of showing the value of the array. There's nothing you can do about that.
You could indeed convert the duration arrays to char as you suggested however I wouldn't recommend it as you will no longer have easy access to easy calculations on durations (you can't add two char arrays for example).
Instead I would recommend you tranpose your cell array and convert it to a table. Tables are easier to work with than cell arrays and have better display. In particular, tables show the content of scalar duration (and datetime), not the type.
cell2table(yourcellarray')

その他の回答 (2 件)

madhan ravi
madhan ravi 2019 年 1 月 14 日
Try using readtable() to read your file.
  5 件のコメント
madhan ravi
madhan ravi 2019 年 1 月 14 日
編集済み: madhan ravi 2019 年 1 月 14 日
upload your file , picture won’t help , "Help us to help you!"
Angelos Mongolias
Angelos Mongolias 2019 年 1 月 14 日
I am sorry for all this mess.
I really appriciate your effort.
I uploaded it.

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


Walter Roberson
Walter Roberson 2019 年 1 月 14 日
You cannot change how the variable browser outputs non numeric values. There is only limited support for changing how the variable browser displays numeric values.

カテゴリ

Help Center および File ExchangeData Type Conversion についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by