Filter löschen
Filter löschen

how to open excel files and write data?

15 Ansichten (letzte 30 Tage)
Devendra
Devendra am 24 Mär. 2024
Bearbeitet: Devendra am 25 Mär. 2024
for m=1:mimgfiles
for n=1:nshapefiles
% Use the logical mask to extract data from ndvi image for villages
village_ndvi = NDVI(logical_mask);
village_ndre = NDRE(logical_mask);
village_cire = CIRE(logical_mask);
avg_village_ndvi = mean(village_ndvi(mask));
avge_village_ndre = mean(village_ndre(mask));
avg_village_cire = mean(village_cire(mask));
end
end
I want to open four different excel files before the loops and write these outputs avg_village_ndvi,avg_village_ndre1,avg_village_cire,and CAF in four different excel files within the loops.
I would appreciate any help in doing the required steps as mentioned above.
dave

Antworten (1)

Alexander
Alexander am 24 Mär. 2024
Bearbeitet: Alexander am 24 Mär. 2024
Just use "xlswrite(FILE,ARRAY,SHEET,RANGE)" in your loop four times with the appropriate file and sheet name. Of cause you have to adjust RANGE with every loop. But must it be in the loop? Why not saveing you data in a variable (type table) and writing with "writetable" to a spreadsheet? It will be much faster.

Kategorien

Mehr zu Data Import from MATLAB finden Sie in Help Center und File Exchange

Produkte


Version

R2024a

Community Treasure Hunt

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

Start Hunting!

Translated by