Create a table with values

I'm trying to run an example I found on the MATLAB examples sectioin, But i get an error
LastName = {'Smith';'Johnson';'Williams';'Jones';'Brown'};
Age = [38;43;38;40;49];
Height = [71;69;64;67;64];
Weight = [176;163;131;133;119];
BloodPressure = [124 93; 109 77; 125 83; 117 75; 122 80];
T = table(Age,Height,Weight,BloodPressure,...
'RowNames',LastName);
Error - Undefined function 'table' for input arguments of type 'cell'.
Error in Untitled5 (line 6) T = table(Age,Height,Weight,BloodPressure,...

1 件のコメント

dpb
dpb 2016 年 6 月 24 日
Which release are you trying with? Or, have you inadvertently created a variable table? Try
which table -all
to see what's getting resolved. If that's it,
clear table
to restore default behavior. If earlier than R2013b, the online doc is always for current release, and may have much that postdates an earlier release.

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

回答 (1 件)

Azzi Abdelmalek
Azzi Abdelmalek 2016 年 6 月 24 日

1 投票

table function was introduced in Matlab R2013b, what version of Matlab are you using?

3 件のコメント

ROJI
ROJI 2016 年 6 月 24 日
i'm using R2013a, is there anyway to make it work for my version?
Azzi Abdelmalek
Azzi Abdelmalek 2016 年 6 月 24 日
You can't make it work with your version, you need to upgrade or use cell arrays.
dpb
dpb 2016 年 6 月 24 日
Well, no, you can't make something "work" that you don't have... :)
But, if you happen to have the Statistics Toolbox with your version there's a similar feature without quite as many bells and whistles in the dataset in it.

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

カテゴリ

ヘルプ センター および File ExchangeTables についてさらに検索

製品

質問済み:

2016 年 6 月 24 日

コメント済み:

dpb
2016 年 6 月 24 日

Community Treasure Hunt

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

Start Hunting!

Translated by