How to replace a value for blank

25 次查看(过去 30 天)
Hello, I have a excel sheet with 3 columns, 1st is with time, and 2nd and 3rd with variable values X1 and X2.
What i want to do is, in column 2 replace the 5th valur for "blank" and in column 3 the 10th value for "blank" as well.
% code
A=readtable('experiencia.xlsx');
[n,m] = size(A);
for i=1:n
A{5,2}= %something to make blank
A{10,3}= %something to make a blank
end
another thing, when i use
% code
A=xlsread('experiencia.xlsx');
end
the 1st column from the picture does not appear
And when i use % code A=readtable('experiencia.xlsx'); end
it apears the table like the picture, but i cant do nothing
Thanks for your help

回答(1 个)

Pawel Jastrzebski
If you import the data as a table, I don't think you are allowed to have a 'blank values'.
Consider a following example:
clear all;
clc;
t = readtable('example.xlsx');
The output will be:
It is possible to 'blank' the cell when you turn the Table in into Cell array:
clear all;
clc;
t = readtable('example.xlsx');
tC = table2cell(t);
tC{3,1} = [];
xlswrite('example1.xlsx', tC);

类别

Help CenterFile Exchange 中查找有关 Data Import from MATLAB 的更多信息

Community Treasure Hunt

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

Start Hunting!

Translated by