reading the data with title

I have a text file with title , I want to add a new column that replicate the header as per column length
I want to have final matrix
1 2 3 cat
3 4 5 cat
5 6 7 cat

댓글 수: 4

Rik
Rik 2021년 11월 9일
What have you tried so far? It seems like you first need to read the file as text.
MOH
MOH 2021년 11월 9일
i used readtable
Rik
Rik 2021년 11월 9일
Since you don't really need to parse the values, it makes more sense to me to read as text.
Also, what exact syntax did you use?
MOH
MOH 2021년 11월 9일
I didn't know how to do it , please help ?

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

답변 (1개)

Rik
Rik 2021년 11월 9일

0 개 추천

Any Google search for 'read text file matlab' should provide you with an answer that works. What I personally use is my readfile function (which you can get from the FEX). If you are using R2017a or later, you can also get it through the AddOn-manager.

카테고리

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

질문:

MOH
2021년 11월 9일

답변:

Rik
2021년 11월 9일

Community Treasure Hunt

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

Start Hunting!

Translated by