필터 지우기
필터 지우기

How to import an matrix to a function or to another program

조회 수: 2 (최근 30일)
Nadia Bica
Nadia Bica 2015년 7월 8일
댓글: Steven Lord 2015년 7월 17일
hello, I have 5 matrices that I need to run a program called 1Casotabela but in this on I have some cicles for where I need to import data from a different file. When those matrices where small I would copy and then past on an editor and create a function. But now these matrices are too big so I would like to know a way to import the data from these diferent programs I have for each matrix. At this point I tried to wrote : function ex1=Geo1(....) ex1=Kgeo1
where Kgeo1 is a matrix, at this point this dont work it apeear an error saying "Undefined function or variable 'Kgeo1'."
The files are attached. thank you
  댓글 수: 1
Steven Lord
Steven Lord 2015년 7월 17일
You will not be able to call your function/script 1casotabela as it is not a valid MATLAB identifier. It does not start with a letter.

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

답변 (1개)

Ghada Saleh
Ghada Saleh 2015년 7월 17일
Hi Nadia,
You can use the Import Data Tool in MATLAB. You can use it to select the data you want to import from a file and specify the output variable. You can also use it to generate an automated function to read the data from different files. Alternatively, you can use importdata function to import different files.
I hope this helps,
Ghada

카테고리

Help CenterFile Exchange에서 Data Import and Analysis에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by