Hi,
I need to add a constant value (600) to all rows of my file = DATA. But, I want to add that DATA to an array.
thanks!

댓글 수: 3

Matt J
Matt J 2023년 1월 22일
What's the format of the file? CSV? Binary? Excel spreadsheet?
Gemma
Gemma 2023년 1월 22일
Yes .xslx file thanks
Rik
Rik 2023년 1월 30일
@Gemma What makes your question a duplicate? Does either answer work for you? Why didn't you accept either of them? And if they didn't work, why didn't you comment with an explanation of what was different from what you want?

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

답변 (2개)

Matt J
Matt J 2023년 1월 22일
편집: Matt J 2023년 1월 22일

0 개 추천

A=readmatrix('yourFile.xlsx');
A(:,end+1)=600;
VBBV
VBBV 2023년 1월 22일
편집: VBBV 2023년 1월 22일

0 개 추천

A=readmatrix('DATA.xlsx'); % assuming DATA your filename
A(:,end+1)=600;
writematrix(A,'DATA.xlsx','Delimiter','tab') % write data back to same file

카테고리

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

질문:

2023년 1월 22일

댓글:

Rik
2023년 1월 30일

Community Treasure Hunt

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

Start Hunting!

Translated by