Matlab xlsread and add new data to opened file

1 visualización (últimos 30 días)
Yoobin Lee
Yoobin Lee el 21 de Mayo de 2020
Respondida: Sindhu Karri el 29 de Mayo de 2020
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

Respuesta aceptada

Sindhu Karri
Sindhu Karri el 29 de Mayo de 2020

Más respuestas (0)

Community Treasure Hunt

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

Start Hunting!

Translated by