Overwrite data Excel in matlab

36 ビュー (過去 30 日間)
joni nababan
joni nababan 2020 年 3 月 9 日
回答済み: Image Analyst 2020 年 3 月 9 日
Hello,
Please Help me. I want to overwrite the data in Excel with matlab where the data I entered there are 2 columns and I want to overwrite the column 2 with new data from uitable
Can you help me?
Here's the code :
load_button :
function loadbutton_Callback(hObject, eventdata, handles)
[filename,path] = uigetfile('.xlsx')
dataExcel = xlsread(fullfile(path,filename),'sheet1','E2:F50')
save_button:
function savebutton_Callback(hObject, eventdata, handles)
[excelName,excelPath] = uiputfile('*.xlsx')
title = {'Fuzzy'}
data = get(handles.uitable1, 'data');
fdata = data(:,3);
sheet = 1
x1Range = 'A1'
xlswrite([excelPath excelName],fdata,sheet,x1Range)
Please help me
  1 件のコメント
darova
darova 2020 年 3 月 9 日
These lines are similar
Can't you just change xlswrite as xlsread?

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

採用された回答

Image Analyst
Image Analyst 2020 年 3 月 9 日
Column 2 is B, not A. So do this:
x1Range = 'B1'; % Column 2 is B not A.
xlFullFileName = fullfile(excelPath, excelName);
xlswrite(excelName, fdata, sheet, x1Range);

その他の回答 (0 件)

カテゴリ

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