How to create the following file for this function script header

I have a function script which should receive through the header the name of the file that contains a data set. This file is to contain two columns of numbers; the first column x-values, the second column y-values. Finally, the file is to be in ascii format.
Can someone please help me with this?

回答 (1 件)

Walter Roberson
Walter Roberson 2020 年 4 月 24 日

0 投票

You can load() the file whose name is passed in.

2 件のコメント

Anthony Bartsch
Anthony Bartsch 2020 年 4 月 24 日
編集済み: Anthony Bartsch 2020 年 4 月 24 日
Okay! Thanks. But what would that file contain, like could you set up code of what I should have in the file I wish to load() with random x and y values? I just wanted to test the function. And what extension would the file be that I wish to be a parameter for the function script? .txt? .m? .mat?
Walter Roberson
Walter Roberson 2020 年 4 月 24 日
The file extension can be anything other than .mat or .fig in order for MATLAB to guess that it contains text.
I would tend to think that the file would contain values generated by your previous question about how to write two columns of numbers to a file.

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

カテゴリ

製品

リリース

R2020a

タグ

質問済み:

2020 年 4 月 24 日

コメント済み:

2020 年 4 月 24 日

Community Treasure Hunt

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

Start Hunting!

Translated by