logical index plot specific columns
이전 댓글 표시
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.
채택된 답변
추가 답변 (0개)
카테고리
도움말 센터 및 File Exchange에서 Tables에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!