How to use workspace variables in functions

6 ビュー (過去 30 日間)
Sanwal Yousaf
Sanwal Yousaf 2015 年 10 月 15 日
編集済み: Sanwal Yousaf 2015 年 10 月 15 日
I am working on writing a script that must extract data that is stored in a .txt file. The program that generates this data stores it in a txt file. There is about 20 lines of header before the data starts and then some data after the data that i am interested in ends. The rows of the data could change depending on the person who was the subject of the data. So i was using the inbuilt Import data function in the Home Tab to import data in a matrix but it is stored as a variable in the workspace. Is there a way that i could use the in the function that i am writing. Or is there a function that could help me call the variable from the workspace that i could incorporate in the script. Any help would be greatly appreciated.

採用された回答

per isakson
per isakson 2015 年 10 月 15 日
編集済み: per isakson 2015 年 10 月 15 日
Use importdata as a function, see &nbsp A = importdata(filename)
If you need more help upload a couple of sample text files.
  2 件のコメント
Sanwal Yousaf
Sanwal Yousaf 2015 年 10 月 15 日
I just did. The data is under the heading Calculated Reaction time,not Raw Reaction times.
Also, the function you suggested works, but it comes down to selectively using data which i am trying to crack.
Sanwal Yousaf
Sanwal Yousaf 2015 年 10 月 15 日
Apologies. It works, the function you suggested. Great Thanks

サインインしてコメントする。

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeWorkspace Variables and MAT-Files についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by