Find a row number in a table?

1 回表示 (過去 30 日間)
Rachel McLaughlin
Rachel McLaughlin 2016 年 5 月 5 日
回答済み: Azzi Abdelmalek 2016 年 5 月 5 日
Hi there,
I have multiple tables of precip data that I am trying to compare against one another. I only want to compare them for the dates where they both have data. How can I trim one table by the start and end date of the other table? Currently the dates are the row names for both the tables.
Thanks

回答 (1 件)

Azzi Abdelmalek
Azzi Abdelmalek 2016 年 5 月 5 日
t1=cell2table(num2cell(randi(2,10,3)))
t2=cell2table(num2cell(randi(2,14,3)))
n=min(size(t1,1),size(t2,1))
a1=t1{1:n,:}
a2=t2{1:n,:}
Then compare a1 and a2

カテゴリ

Help Center および File ExchangeDates and Time についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by