display variables with different classes

2 ビュー (過去 30 日間)
Robert Jones
Robert Jones 2022 年 8 月 7 日
コメント済み: Voss 2022 年 8 月 7 日
Hello,
I have 3 variables a, b, c that I would like to display, as in disp (a,b,c)
a =
0.0029 0
b =
1×4 cell array
{[0]} {[0.5000]} {[0.5000]} {[10]}
c =
'20220807T063730'
I am trying to get the following displayed
20220807T063730 0 0.5000 0.5000 10 0.0029 0
I spent quite a bit trying to do all the conversions required by the disp command, but was not able to find a satisfacroty solution.
Help would be a appreciated.
Thank you

採用された回答

Voss
Voss 2022 年 8 月 7 日
Maybe use fprintf for this
a = [0.0029 0];
b = {0 0.5 0.5 10};
c = '20220807T063730';
fprintf(1,'%s',c)
fprintf(1,' %g',b{:},a)
  2 件のコメント
Robert Jones
Robert Jones 2022 年 8 月 7 日
that works, thank you
Voss
Voss 2022 年 8 月 7 日
You're welcome!

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

その他の回答 (0 件)

カテゴリ

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

製品


リリース

R2019b

Community Treasure Hunt

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

Start Hunting!

Translated by