Difficulty reducing the number of rows in a table

3 ビュー (過去 30 日間)
ampaul
ampaul 2017 年 7 月 14 日
コメント済み: ampaul 2017 年 7 月 14 日
Hi. I have a 75*4 table. The table describes 3 classes, where 1:25 = class1, 26:50 = class2, and 51:75 = class3.
For my code, I would like to only pull the first 5 points from each class to create a new 15*4 matrix. However, when I run my code, I receive an error. Here is the code below:
Table15 = Table75([1:5,:],[25:30,:],[50:55,:]);
What could be wrong? Thanks

回答 (1 件)

Image Analyst
Image Analyst 2017 年 7 月 14 日
Your first array has 5 rows while the others have 6. After you get done slapping your forehead, you might try this:
Table15 = Table75([1:5,:],[26:30,:],[51:55,:]);
or similar.
  1 件のコメント
ampaul
ampaul 2017 年 7 月 14 日
Wow.. my mistake. Unfortunately, the code is still not working. I need a bit more practice it seems... Thank you

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

カテゴリ

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

Community Treasure Hunt

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

Start Hunting!

Translated by