fprintf replace values from xlsread table
Afficher commentaires plus anciens
I have a column of 100 zeroes and in certain positions in the column I want them to be replaced with a value. The position and replacement values are held inside the trial.xlsx file. What could I use to do this. Previously I was using b(positionvalue)=replacementvalue but now there are too many position values to just type them in.
b=zeros(100,1);
a = xlsread('trial.xlsx','Sheet1','A2:B1473');
c = 9 * ones(length(b),1);
c(b==0) = 1;
d=[c,b];
fileID = fopen('xlsreadtrial.txt','w');
fprintf(fileID,'%.*f\n',d');
fclose(fileID);
5 commentaires
Paolo
le 12 Juin 2018
Could you attach 'trial.xlsx' file?
Anna Cole
le 12 Juin 2018
Paolo
le 12 Juin 2018
I have a column of 100 zeroes
How can you fit 1476 lines in a column of 100 zeros?
Anna Cole
le 12 Juin 2018
Walter Roberson
le 12 Juin 2018
How would position 101927062 be converted into an index into b ?
Réponse acceptée
Plus de réponses (0)
Catégories
En savoir plus sur Multidimensional Arrays dans Centre d'aide et File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!