how do i update a value of a particular column of a cell without changing other columns and store the updated value along with other columns in other cell?
7 Ansichten (letzte 30 Tage)
Ältere Kommentare anzeigen
Rohit P
am 23 Jan. 2022
Kommentiert: Rohit P
am 24 Jan. 2022
Hello everyone,
i read an excel file using xlsread in matlab.the excel file contains 2 columns and 5 rows. the structure of excel file is as follows:
Parameter Value
a 10
b 3
c 5
d 6
e 7
Now,Here i want to change the value of a particular column(lets say i want to change value of parameter a) the value should be present in a particular range say [5 to 15].Now,after changing its value i want to store the updated parameter along with other unchanged parameters in a separate cell and write that updated cell into excel using xlswrite. please note that original excel file which we read into matlab should not be changed or we can say that i have to create a completely different excel sheet and not update the original one.
Please Help,any help would be appreciated.
Thank You in advance
0 Kommentare
Akzeptierte Antwort
Image Analyst
am 23 Jan. 2022
[~, ~, raw] = xlsread(inputFileName); % Read from input file.
raw{someRow, someColumn} = someDifferentValue; % Replace the cell with something different.
xlswrite(outputFileName, raw); % Write the cell out to a new file.
Of course you need to assign the filenames in advance, and also have the new value available.
Weitere Antworten (0)
Siehe auch
Kategorien
Mehr zu Spreadsheets finden Sie in Help Center und File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!