logical index plot specific columns
Show older comments
Hi,
I made excel file with date and US dollar spent from 2015 to 2018. I graphed the two columns in excel but I also want to apply same knowledge in MATLAB using logical index. I want to use logical index using string compare to make a new table with each year corresponds with the amount of money spent in that specific year.
here is my first try but not sure why logical index doesn't work.
%%
clc
clear
%%
% read table
data = readtable('SpentinUSDollar.xlsx')
Udate = strcmp(data(:,1),'2015');
tdate = data(Udate,:);
does this work to use logical index? I was thinking to use for loop and the size of the table. Then to make MATLAB to look for 2015 and create table between this year and US Dollar. See the file for more details.
Accepted Answer
More Answers (0)
Categories
Find more on Tables in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!