フィルターのクリア

How can I form a table including a string and some other numbers in matlab?

27 ビュー (過去 30 日間)
R@SH
R@SH 2021 年 10 月 5 日
コメント済み: R@SH 2021 年 10 月 26 日
Hi Dear All,
I wanted to form a table with some parameters in matlab, like below:
A=table (B,C,D,....);
All of the parameters (B,C,...) but only one are numbers. my problem is with that one parameter which is an string, a binary number.
But I seem not to be allowed to proceed with this job unless I eliminate the one string from my table.
I would appreciate you if you can tell me how can I have this table with one string and some other numbers.

採用された回答

Steven Lord
Steven Lord 2021 年 10 月 5 日
If you want to create a table with one row and one of the variables is a row char vector, you could wrap that variable in a cell array or convert it to a string scalar.
name = 'Steve';
height = 72;
age = NaN;
officeFloor = 3;
T = table({name}, height, age, officeFloor)
T = 1×4 table
Var1 height age officeFloor _________ ______ ___ ___________ {'Steve'} 72 NaN 3
T2 = table(string(name), height, age, officeFloor)
T2 = 1×4 table
Var1 height age officeFloor _______ ______ ___ ___________ "Steve" 72 NaN 3

その他の回答 (0 件)

カテゴリ

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

タグ

製品

Community Treasure Hunt

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

Start Hunting!

Translated by