필터 지우기
필터 지우기

user prompt to select which table to process (and column)

조회 수: 2 (최근 30일)
Georgios Galatis
Georgios Galatis 2020년 3월 19일
편집: Georgios Galatis 2020년 3월 23일
Hi All,
I have a relative trivial question that I would be needing some guidence.
I have imported a data set called file22. The form of file22 is as follows:
If I want to access file22 Time column I type file22.Time, and the whole time column is selected..
I have multiple files:
file22,
file23,
file24 etc
What I am stuggling is to figure out a way where the user is prompted to type the file s/he wants to process, I have this but doesnt seem to work:
prompt = 'name of file : ';
FileName=input(prompt);
%conditioning tables for processing
%time stamp conditioning
FileName.Time=FileName.Time*60*60*24;
What I get is a table called file name.
  댓글 수: 2
Ajay Kumar
Ajay Kumar 2020년 3월 20일
Can you try to explain it more clearly, for example with inputs and expected outputs with some screenshots if possible?
Georgios Galatis
Georgios Galatis 2020년 3월 20일
Hi,
As mentioned in the question I have loaded into matlab several files:
file22
file23
file24
etc
Each file has been loaded as a table with 3 columns (Time,AMU,Pressure). If I whant to access the "'Time"column I write i.e file22.Time and Matlab will output the Time column of the table.
file22.Time
Since I have many files, as described before, I would like the script to ask the user what file it should handle:
prompt = 'name of file : ';
FileName=input(prompt);
hence ín this case if the user types file22, then
FileName.Time
Should read out the same table, instead though it creats the same file22 table under the name FileName

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

답변 (0개)

카테고리

Help CenterFile Exchange에서 Other Formats에 대해 자세히 알아보기

제품

Community Treasure Hunt

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

Start Hunting!

Translated by