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

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

you mean this?
var=fullfile('c:\users\matlab','examine.txt')
var = 'c:\users\matlab/examine.txt'

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

답변 (1개)

Cris LaPierre
Cris LaPierre 2023년 1월 30일

0 개 추천

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.

카테고리

도움말 센터File Exchange에서 Printing and Saving에 대해 자세히 알아보기

태그

질문:

2023년 1월 30일

댓글:

2023년 2월 1일

Community Treasure Hunt

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

Start Hunting!

Translated by