add constant value to row

2 ビュー (過去 30 日間)
Gemma
Gemma 2023 年 1 月 22 日
コメント済み: Rik 2023 年 1 月 30 日
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 件のコメント
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 日
A=readmatrix('yourFile.xlsx');
A(:,end+1)=600;

VBBV
VBBV 2023 年 1 月 22 日
編集済み: VBBV 2023 年 1 月 22 日
A=readmatrix('DATA.xlsx'); % assuming DATA your filename
A(:,end+1)=600;
writematrix(A,'DATA.xlsx','Delimiter','tab') % write data back to same file

カテゴリ

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

Community Treasure Hunt

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

Start Hunting!

Translated by