How can I align a file(txt, xls) onto a single variable?

1 回表示 (過去 30 日間)
Matlab learner
Matlab learner 2023 年 1 月 30 日
コメント済み: Fangjun Jiang 2023 年 2 月 1 日
When a file name is 'examine.txt' at location c:\users\matlab, can I align this file on a single variable 'var' by
var= 'C:\Users\matlab\examine.txt';?
  1 件のコメント
Fangjun Jiang
Fangjun Jiang 2023 年 2 月 1 日
you mean this?
var=fullfile('c:\users\matlab','examine.txt')
var = 'c:\users\matlab/examine.txt'

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

回答 (1 件)

Cris LaPierre
Cris LaPierre 2023 年 1 月 30 日
I would use the readmatrix or readtable function.
I'd recommend taking a little time to go through MATLAB Onramp. It will introduce you to the fundamentals of using MATLAB for free. The entire course should take around 2 hours, but you can also go through individual chapters as needed. For example, Ch 10 covers importing data.
  1 件のコメント
Matlab learner
Matlab learner 2023 年 2 月 1 日
Thanks it helped me a lot:)

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

カテゴリ

Help Center および File ExchangeTables についてさらに検索

タグ

Community Treasure Hunt

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

Start Hunting!

Translated by