現在この質問をフォロー中です
- フォローしているコンテンツ フィードに更新が表示されます。
- コミュニケーション基本設定に応じて電子メールを受け取ることができます。
problem with columnWidth..how solve it
3 ビュー (過去 30 日間)
古いコメントを表示
aldo
2023 年 10 月 22 日
size(T)
ans =
73 9
T =
73×9 table
T.ColumnWidth={50,30,30,30,30,30,30,30,30}
Error using .
To assign to or create a variable in a table, the number of rows must match the height of the table.
12 件のコメント
Dyuman Joshi
2023 年 10 月 22 日
移動済み: Dyuman Joshi
2023 年 10 月 22 日
The size of the data to be added to the table must be compatible with the dimensions of the table, which is what the error message (explicitly) states as well.
Use -
T.ColumnWidth = [50;30;30;30;30;30;30;30;30];
aldo
2023 年 10 月 22 日
移動済み: Dyuman Joshi
2023 年 10 月 22 日
Error using .
To assign to or create a variable in a table, the number of rows must match the height of the table.
Error in CaricaListaStrategie_Struct (line 60)
T.ColumnWidth=[50,30,30,30,30,30,30,30,30];
aldo
2023 年 10 月 22 日
移動済み: Dyuman Joshi
2023 年 10 月 22 日
Error using .
To assign to or create a variable in a table, the number of rows must match the height of the table.
Error in CaricaListaStrategie_Struct (line 60)
T.ColumnWidth=[50;30;30;30;30;30;30;30;30];
Dyuman Joshi
2023 年 10 月 22 日
編集済み: Dyuman Joshi
2023 年 10 月 22 日
I somehow mixed up the dimensions, Sorry.
The table has 73 rows, thus the data for ColumnWidth should have 73 rows as well.
Do you want to add the data related to a variable present in the column? Or is there a criteria/logic for adding that data?
Voss
2023 年 10 月 22 日
移動済み: Voss
2023 年 10 月 22 日
If you have a uitable (UIT) whose data is a table variable (T)
UIT = uitable(); % create a uitable (graphics object)
UIT.Data = T; % set the uitable's Data to be the table variable T
Then you can set the ColumnWidth of the uitable like this:
UIT.ColumnWidth = {50,30,30,30,30,30,30,30,30}; % UIT has 9 columns
However, using the same syntax on the table variable T tries to add a variable/column called "ColumnWidth" to the table T, which produces an error in this case because the number of values given doesn't match the number of rows of T.
T.ColumnWidth = {50,30,30,30,30,30,30,30,30} % T has 73 rows, so this doesn't work
回答 (0 件)
参考
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!エラーが発生しました
ページに変更が加えられたため、アクションを完了できません。ページを再度読み込み、更新された状態を確認してください。
Web サイトの選択
Web サイトを選択すると、翻訳されたコンテンツにアクセスし、地域のイベントやサービスを確認できます。現在の位置情報に基づき、次のサイトの選択を推奨します:
また、以下のリストから Web サイトを選択することもできます。
最適なサイトパフォーマンスの取得方法
中国のサイト (中国語または英語) を選択することで、最適なサイトパフォーマンスが得られます。その他の国の MathWorks のサイトは、お客様の地域からのアクセスが最適化されていません。
南北アメリカ
- América Latina (Español)
- Canada (English)
- United States (English)
ヨーロッパ
- Belgium (English)
- Denmark (English)
- Deutschland (Deutsch)
- España (Español)
- Finland (English)
- France (Français)
- Ireland (English)
- Italia (Italiano)
- Luxembourg (English)
- Netherlands (English)
- Norway (English)
- Österreich (Deutsch)
- Portugal (English)
- Sweden (English)
- Switzerland
- United Kingdom(English)
アジア太平洋地域
- Australia (English)
- India (English)
- New Zealand (English)
- 中国
- 日本Japanese (日本語)
- 한국Korean (한국어)