selecting columns from table

101 ビュー (過去 30 日間)
Yusa Calik
Yusa Calik 2021 年 5 月 28 日
コメント済み: Walter Roberson 2025 年 4 月 20 日
hello, i want to create an application which reads the given table and allows user to select columns and then recreating a table with the selected columns.
I am working on forecasting electricity prices and getting data from https://www.epias.com.tr/en/ my code is working on a fixed table template and that is date-hour-price. But some excel files have more than one currency and the table can be date-hour-turkish lira-usd-cad. i want user to be able to choose currency and work on it. reads table and user selects columns (date-hour-try/usd/cad) and creates new table consisted selected columns. My code is https://pastebin.com/UpSYsQrQ. Reading table and formatting is done but. selection callback and confirm push button callbacks are not working properly. it creates a table but table is irrelevant. it's like i can't keep the read data and create an empty one.

回答 (2 件)

Manas Meena
Manas Meena 2021 年 5 月 31 日
If you want to pull columns from an existing table and create a new table you can use subscripting.
For example you have a table with 10 columns and you want to pull column 1,2,4 and 9 then you can just use
NumericValueTable(:,[1 2 4 9])

Shiraz
Shiraz 2025 年 4 月 20 日
I have a CSV file where there are 8 coloums and 447512 rows. I want to only select row 3 to plot a graph based on it. How do I do this?. Thanks
  1 件のコメント
Walter Roberson
Walter Roberson 2025 年 4 月 20 日
filename = 'AppropriateName.csv';
opt = detectImportOptions(filename);
opt.Datalines = 3;
T = readmatrix(filename, opt);
plot(T)

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

カテゴリ

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

Community Treasure Hunt

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

Start Hunting!

Translated by