writematrix with Range has problem.
12 vues (au cours des 30 derniers jours)
Afficher commentaires plus anciens
Hello.
I am confusing while I am using 'writematrix'.
Here is the code have the problem.
for i=1:5
CellRange = ['A',num2str(i)];
writematrix(filename,'Sheet',1,'Range','CellRange')
end
I know the Range should be Character type.
for i=1:5
firstRow = i;
firstCol = 'C';
cellRange = [firstCol,num2str(firstRow)];
end
Result of cellRange is character type as I expected.
But when I applied this into upper code, it's error message said that 'The range must be a character vector of the form 'A1:B2' or 'A1''
Is there something adjust for this?
Thank you.
2 commentaires
Walter Roberson
le 29 Mar 2020
writematrix(filename,'Sheet',1,'Range',CellRange)
You are passing in literally the phrase CellRange as the range, instead of the content of it.
Réponses (0)
Voir également
Catégories
En savoir plus sur File Operations dans Help Center et File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!