필터 지우기
필터 지우기

How do I do this? Pass a filename to a function?

조회 수: 9 (최근 30일)
new user 00
new user 00 2018년 7월 1일
댓글: Image Analyst 2018년 7월 2일
I have created a function to browse a file in a gui. Now I have another function which does some calculations with the variables in the browsed file. So how do I load that file's contents in the new function?

채택된 답변

Image Analyst
Image Analyst 2018년 7월 1일
In your first function you pass the filename to the new function:
results = new_function(filename);
Then in new_function you read in the data and do something with it.
function results = new_function(filename)
data = importdata(filename); % of xlsread() or csvread() or readtable() or whatever...
% Now do something with data....
  댓글 수: 5
new user 00
new user 00 2018년 7월 2일
don't mistake me. But even now I'm not so clear with what to do. Is there any videos related to this?
Image Analyst
Image Analyst 2018년 7월 2일
Stuart has an excellent collection of them here:
two of which are the second and fourth links on Stephen's list.

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

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Environment and Settings에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by