Matlab xlsread and add new data to opened file

조회 수: 1 (최근 30일)
Yoobin Lee
Yoobin Lee 2020년 5월 21일
답변: Sindhu Karri 2020년 5월 29일
Hello, I'm trying to open certain excel file with xlsread and add user inputs to that file using xlswrite. But when I open excel file after adding new data, I cannot find original data but added ones. Can anybody help me with this?
close all;
clear all;
clc;
[num,txt]=xlsread('filename.xlsx'); %I have both num&txt data, including header
nn=length(txt);
n=nn+1;
A={};
while(1)
m=input('');
if m==1
fprintf('---------------------------\n')
number=input('- Sentence :','s'); %here I'll get number and text data
Anew={number(1:3),number(4),number(5:8)};
A(n,1)=(Anew(1,1)); %num
A(n,2)=(Anew(1,2)); %txt
A(n,3)=(Anew(1,3)); %num
n=n+1;
end
if m==0
xlswrite([num,txt],A); %actually I'm not sure what to write here :(
break;
end
end

채택된 답변

Sindhu Karri
Sindhu Karri 2020년 5월 29일

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Spreadsheets에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by