필터 지우기
필터 지우기

How to use "Date Picker" to read a specific row and a column from a csv file that are associated with the date that was selected?

조회 수: 2 (최근 30일)
How to use "Date Picker" to read a specific row and a column from a csv file that are associated with the date that was selected and display this value on a "Edit Field (Numeric)".
The Date Picker format is mm/dd/yyyy
For example, if a user select 01/27/2022 than I want to search for which row on the first column has a date that match the selected date once this row is founded then I want to display the value that is on the same row but on the second column into the "Edit Field (Numeric)".
I know that I must have a function to search for the matching date but I am not sure where to start from.

채택된 답변

KSSV
KSSV 2022년 3월 9일
You can load the csv file data into MATLAB workspace using readtable.
And then you can use ismember to get the index of the required date.
  댓글 수: 2
Steven Shaaya
Steven Shaaya 2022년 3월 9일
I tried this but it says A and B must both be tables, or both be timetables. Let us forget about the app designer for a meanwhile.
If I have a file that has a column of date and the first row start with 01/01/2022 and I have 356 rows of such data up to 12/31/2022. And the user enter 01/27/2022. Would you please tell in details how to search for this date more in detials. I read about ismember but I still can not get it to work.
In fact, I'm not intrested in the first column, Im intrested on my my second and third columns because they have the data of x-axis and y-axis which I have to plot.
Also, I have more than 356 rows but I am just trying to make my question simple and once I get this part to work then I can get the rest to work.
KSSV
KSSV 2022년 3월 9일
You have to access the columns of the table. T.(1) is first column.

댓글을 달려면 로그인하십시오.

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Dates and Time에 대해 자세히 알아보기

태그

제품


릴리스

R2019b

Community Treasure Hunt

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

Start Hunting!

Translated by