Hi everyone,
Is there any existing function that allows to draw a simple 2D Graph into a .txt file ?
For example, let's say we have :
X = [0 1 2 3]
Y = [2 1 1 4]
fileID = fopen('mytxtFile.txt','w') ;
I doubt there is , but is there a function "drawIntoTxtFile" such that if I do : drawIntoTxtFile(fileID,X,Y), a "text graph" is generated into the txt file, which may look like this :
^
4 | X
3 |
2 X
1 | X X
0 |_ _ _ _ _ _ __ _ _ _ _ _ _ _ _>
0 1 2 3
I'd rather avoid coding myself the function if it already exists obviously, but couldn't find any help online.
Thanks a lot to you

2 件のコメント

Ameer Hamza
Ameer Hamza 2020 年 9 月 22 日
I don't think such a thing already exists, but what is the reason for doing this? Do you want to display a graph in some text-based terminal?
CN75010
CN75010 2020 年 9 月 22 日
Yes, I actually need to draw a graph into a txt file for a project, and just making a table won’t cut it for my needs

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

 採用された回答

Ameer Hamza
Ameer Hamza 2020 年 9 月 22 日
編集済み: Ameer Hamza 2020 年 9 月 22 日

0 投票

Someone has done something similar in python: https://github.com/nschloe/termplotlib. You can use this library in MATLAB: https://www.mathworks.com/help/matlab/call-python-libraries.html.

2 件のコメント

CN75010
CN75010 2020 年 9 月 22 日
Thanks, that’s perfect !
Ameer Hamza
Ameer Hamza 2020 年 9 月 22 日
I am glad to be of help!

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

その他の回答 (0 件)

カテゴリ

ヘルプ センター および File ExchangeData Import and Export についてさらに検索

製品

リリース

R2016b

タグ

質問済み:

2020 年 9 月 22 日

コメント済み:

2020 年 9 月 22 日

Community Treasure Hunt

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

Start Hunting!

Translated by